Metadata caching

The driver supports metadata caching, which offers several key benefits:

  • Improved performance: Retrieving schema information—such as table structures, column definitions, and data types takes significantly less time, as the driver accesses metadata from the local cache instead of querying Salesforce repeatedly.
  • Reduced API calls: The driver minimizes the number of API calls to Salesforce to avoid exceeding API usage limits.
  • Offline accessibility: The data source structure can be accessed even when the connection to Salesforce is unavailable or temporarily interrupted.
  • Consistency across sessions: The driver maintains a consistent database schema during a session, even if the Salesforce schema changes.

By default, metadata caching is enabled, and metadata is refreshed 24 hours after it’s retrieved by the application.

Note

Metadata is cleared from the cache when the ODBC driver is unloaded from memory—for example, when the application using the ODBC driver is closed.

To change the metadata refresh period or turn off metadata caching, follow one of the following methods:

  • Configure metadata caching using ODBC Data Source Administrator
  • Configure metadata caching using a connection string

Configure metadata caching using ODBC Data Source Administrator

1. Select your DSN and click Configure.

A selected DSN in ODBC Data Source Administrator

2. Select the Advanced Settings tab.

3. In Cache Metadata, select the cache refresh interval:

  • False - Metadata caching is disabled.
  • 1 Hour - Metadata is refreshed every hour.
  • 1 Day - Metadata is refreshed every 24 hours.
  • 1 Month - Metadata is refreshed every 30 days.
  • True (Infinite) - Metadata is not refreshed.

4. Click OK.

The Cache Metadata drop-down list on the Advanced Settings tab in the Devart ODBC Driver for Salesforce Configuration dialog

Configure metadata caching using a connection string

You can configure the cache refresh interval using the Cache Metadata parameter.

The possible values are:

  • False - Metadata caching is disabled.
  • Hour - Metadata is refreshed every hour.
  • Month - Metadata is refreshed every 30 days.
  • True - Metadata is not refreshed.

If the Cache Metadata parameter is not specified, metadata caching is enabled, and metadata is refreshed every 24 hours.

Example

DRIVER=Devart ODBC Driver for Salesforce;
Data Source=https://login.salesforce.com;
User ID=your_email;
Password=your_password;
Security Token=your_security_token;
Cache Metadata=Hour