dotConnect for Salesforce can cache Salesforce.com and Database.com data on the local computer. Using cache gives you the following benefits:
- Increased query performance - querying an embedded cache database is much faster than using Salesforce Web service API to query data from Salesforce.com or Database.com.
- Working offline - if all the required data are cached, and metadata for this Salesforce.com or Database.com account are cached too, you don't need to establish a Web service session with Salesforce.com or Database.com to get this data, and the application can work offline untill the cache needs to be refreshed or updating data is required. Cache and metadata databases can be even transferred to another PC, and used on it. However, you will need to connect to Salesforce.com or Database.com to update data. Use the DeferredLogin connection string parameter to control if the actual Salesforce connection is established immediately when you open SalesforceConnection or when you query the data not present in the cache or modify data.
dotConnect for Salesforce caches data on per-table basis. That means you can create, modify, and delete cache for each table separately. Cache must be created explicitly, by default data is not cached.
When creating a cache for a table, you may optionally specify the filter condition to store only the objects you need in cache. However, note that when you query this table, you will get only the filtered objects that are stored in the cache. Even if the query does not contain such filter, you still will get only the filtered objects.
Once a cache is created, its use is transparent to the application. After creating cache, the next query to this table (object) will populate the cache. After that all the queries referencing to this object use cached data of this object instead of querying it from Salesforce.com or Database.com.
Cache is stored in a local SQLite database. It is located in the user Application Data directory (C:\Users\{user name}\AppData\Roaming) by default and is named by the Salesforce.com or Database.com account name, however, you may set its location in the "Data Cache" connection string parameter. Cache database is shared between different connections to the same Salesforce.com or Database.com account and even can be transferred to other computers.