Contact Us 1-800-596-4880

Upgrading and Migrating Snowflake Connector to 2.x

Upgrade Anypoint Connector for Snowflake (Snowflake Connector) from version 1.x to version 2.x.

Supported Upgrade Paths

From Version To Version

1.x

2.x

Changes

2.0

  • Snowflake Connector 2.0 requires Snowflake JDBC driver 4.4.1. Use the full snowflake-jdbc jar, or snowflake-jdbc-fips in a FIPS environment. JDBC 3.x drivers aren’t supported. Replace the shared JDBC driver library in your application. For more information, see Using Anypoint Studio to Configure Snowflake Connector.

  • Key-pair authentication resolves Private Key File Path from an absolute path, a path relative to the Mule runtime working directory, or the application classpath. A classpath resource inside a jar is copied to an owner-only temporary file. A missing file fails connection initialization. If Private Key Password is set, the connector throws PrivateKeyLoadException. If Private Key Password isn’t set, the connector throws IllegalStateException with the message Unable to resolve private key file. For more information, see Key-pair Connection.

  • If you set the JDBC driver system property net.snowflake.jdbc.enableBouncyCastle, use net.snowflake.jdbc.useBundledBouncyCastleForPrivateKeyDecryption instead. JDBC 4.x ignores the old property. The new property defaults to true. The connector decrypts an encrypted private key itself and doesn’t read this property.

  • The pooling profile Max Wait value is now applied as the pool checkout timeout, in milliseconds. Previously, a non-zero Max Wait was ignored, so an exhausted pool waited indefinitely. A non-zero Max Wait now fails the checkout with SNOWFLAKE:CONNECTIVITY after the wait elapses. A Max Wait of 0 still waits indefinitely. For more information, see Snowflake Db Pooling Profile.

  • The On Table Row source skips a row when the watermark column is null, instead of failing the poll with a NullPointerException. A watermark value that isn’t serializable is logged and skipped, and the poll continues with the remaining rows. For more information, see On Table Row.

  • These libraries are upgraded to address reported security vulnerabilities:

    • The Guava library is upgraded to version 33.8.0-jre.

    • The commons-collections4 library is upgraded to version 4.6.0.

    • The commons-lang3 library is upgraded to version 3.21.0.

    • The bcpkix-fips library is upgraded to version 2.1.13.

Requirements

Ensure your system meets the following compatibility requirements before you perform the upgrade:

Application/Service Version

Mule runtime

4.3.0 and later

OpenJDK

8, 11, and 17

Snowflake JDBC

4.4.1 (snowflake-jdbc or snowflake-jdbc-fips)

Upgrade Prerequisites

Before you perform the upgrade, you must:

  1. Create a backup of your files, data, and configuration in case you need to restore to the previous version.

  2. Ensure that your environment meets the version 2.x requirements, including Mule runtime 4.3.0 or later and Snowflake JDBC driver 4.4.1.

  3. Replace the Snowflake JDBC 3.x shared library with the full 4.4.1 jar.

  4. If your application sets net.snowflake.jdbc.enableBouncyCastle, change it to net.snowflake.jdbc.useBundledBouncyCastleForPrivateKeyDecryption. JDBC 4.x ignores the old property, and the new property defaults to true.

  5. If your pooling profile sets a non-zero Max Wait, plan for checkout failures after that wait. A Max Wait of 0 still waits indefinitely.

Upgrade Steps

Follow these steps to perform the upgrade from Snowflake Connector 1.x to Snowflake Connector 2.x:

  1. In Anypoint Studio, create a Mule project.

  2. In the Mule Palette view, click Search in Exchange.

  3. In the Add Dependencies to Project window, enter snowflake in the search field.

  4. In the Available modules section, select Snowflake Connector - Mule 4 and click Add.

  5. Click Finish.

  6. Verify that the mule4-snowflake-connector dependency version is 2.x.x in the pom.xml file, where x.x is the minor release and patch version number. For example, if you are upgrading to version 2.0, the dependency version in the pom.xml file should be 2.0.0.

  7. Replace the shared JDBC driver with net.snowflake:snowflake-jdbc:4.4.1, or net.snowflake:snowflake-jdbc-fips:4.4.1 in a FIPS environment.

Studio upgrades the connector automatically.

Verify the Upgrade

After you install the latest version of the connector, follow these steps to verify the upgrade:

  1. In Studio, verify that there are no errors in the Problems or Console views.

  2. Check the project pom.xml file and verify that the connector version is 2.0.0 and that the JDBC driver is 4.4.1.

  3. Test the connection and verify that the operations work.

  4. If you use key-pair authentication, confirm that the private key file resolves from its path or from the application classpath.

  5. If you use the On Table Row source, confirm that rows with a null watermark are skipped and that later rows are still processed.

Troubleshooting

If Studio reports that the required driver class is missing, the jar doesn’t contain net.snowflake.client.api.connection.SnowflakeConnection. Replace a JDBC 3.x jar with the full Snowflake JDBC 4.4.1 driver.

If a non-zero Max Wait now returns SNOWFLAKE:CONNECTIVITY, the pool checkout is timing out. Increase Max Wait or set it to 0 to wait indefinitely.

If key-pair authentication can’t find the private key file, check Private Key File Path. An encrypted key, with Private Key Password set, fails with PrivateKeyLoadException. An unencrypted key fails with IllegalStateException.

If there are problems with caching the parameters and caching the metadata, try restarting Studio.

Revert the Upgrade

If it is necessary to revert to the previous version of Snowflake Connector, change the mule4-snowflake-connector dependency version in the project’s pom.xml file to the previous version and restore the Snowflake JDBC 3.x driver.

You must update the project’s pom.xml file in Anypoint Studio.