Skip to content

Fine Tuning JDBC Connection for Databricks Unity Catalog

Optimizing JDBC connection parameters can help improve the stability and performance of your Databricks Unity Catalog integrations. This guide provides general recommendations and steps for adjusting JDBC connection settings to best suit your environment and workload requirements.

Configuration Properties

Feature Description Default Value Possible Values
JDBC Socket Timeout The number of seconds that the TCP socket waits for a response from the server before raising an error on the request. 18000 seconds (5 hours) Any positive integer (in seconds)
JDBC Connection Timeout The maximum time in milliseconds to wait when attempting to connect to the database before timing out. 30000 milliseconds (30 seconds) Any positive integer (in milliseconds, minimum 250ms)

Setup

Warning

Replace the <PLEASE_CHANGE> placeholder with appropriate values for your environment.

  1. Navigate to SettingsApplications in the Self-Managed Portal.

  2. From the list of Connected Applications, select Databricks Unity Catalog.

  3. Click the icon or the Account Name to modify the settings.

  4. On the Edit Application screen, go to Access Management.

  5. Under ADVANCED tab, add the following properties under Add New Custom Properties:

    Bash
    1
    2
    3
    4
    5
    # JDBC socket timeout configuration (in seconds)
    ranger.policysync.connector.0.jdbc.socket.timeout.in.seconds=<PLEASE_CHANGE>
    
    # JDBC connection timeout configuration (in milliseconds)
    ranger.policysync.connector.0.jdbc.connection.timeout.in.ms=<PLEASE_CHANGE>
    

  6. Click SAVE to apply the changes.

To configure the JDBC timeout settings, update the following properties in Privacera Manager:

  1. SSH to the instance where Privacera Manager is installed.

  2. Run the following command to open the .yml file to be edited:

    If you have multiple connectors, then replace instance1 with the appropriate connector instance name.

    Bash
    vi ~/privacera/privacera-manager/config/custom-vars/connectors/databricks-unity-catalog/instance1/vars.connector.databricks.unity.catalog.yml
    
  3. Set the following properties to configure the JDBC timeout settings:

    YAML
    1
    2
    3
    4
    5
    # The maximum time to wait for data on a socket after connection establishment (default: 18000 seconds)
    CONNECTOR_DATABRICKS_UNITY_CATALOG_JDBC_SOCKET_TIMEOUT_IN_SECONDS: "<PLEASE_CHANGE>"
    
    # The maximum time to wait when attempting to connect to the database (default: 30000 milliseconds)
    CONNECTOR_DATABRICKS_UNITY_CATALOG_JDBC_CONNECTION_TIMEOUT_IN_MS: "<PLEASE_CHANGE>"
    

  4. Once the properties are configured, run the following commands to update your Privacera Manager platform instance:

    Step 1 - Setup which generates the helm charts. This step usually takes few minutes.

    Bash
    cd ~/privacera/privacera-manager
    ./privacera-manager.sh setup
    
    Step 2 - Apply the Privacera Manager helm charts.
    Bash
    cd ~/privacera/privacera-manager
    ./pm_with_helm.sh upgrade
    
    Step 3 - Post-installation step which generates Plugin tar ball, updates Route 53 DNS and so on.

    Bash
    cd ~/privacera/privacera-manager
    ./privacera-manager.sh post-install
    
  1. In PrivaceraCloud portal, navigate to Settings -> Applications.

  2. On the Connected Applications screen, select Databricks Unity Catalog.

  3. Click the pen icon or the Account Name to modify the settings.

  4. On the Edit Application screen, go to Access Management -> ADVANCED tab.

  5. Under Add New Custom Properties, add the following properties:

    Bash
    1
    2
    3
    4
    5
    # JDBC socket timeout configuration (in seconds)
    ranger.policysync.connector.0.jdbc.socket.timeout.in.seconds=<PLEASE_CHANGE>
    
    # JDBC connection timeout configuration (in milliseconds)
    ranger.policysync.connector.0.jdbc.connection.timeout.in.ms=<PLEASE_CHANGE>
    

  6. Click SAVE to apply the changes.

Performance Impact

  • Longer timeouts may improve stability but can delay error detection.
  • Shorter timeouts provide faster error detection but may cause premature failures.
  • Test thoroughly in your environment before applying to production.

Comments