Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
DB Interface Module User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

9.5 Result Schema Caching

In many applications, the schema of the database tables being queried does not change. Tables are designed when the application is designed, and the layout and structure remain the same while the program is running. In these cases, result schema caching may be enabled. Enabling result schema caching instructs the DB Interface Module not to fetch result schema information when re-executing a query. This can result in a performance gain if the same RWDBSelectors or RWDBOSqls are used repeatedly.

Result schema caching is managed by the RWDBEnvironmentHandle associated with the RWDBDatabase. To enable result schema caching, we must:

Example 11: Result schema caching

On //1, the environment handle is obtained from the RWDBDatabase. On //2, the schema cache is enabled. On //3, the selector is executed. On this execution, the result schema is fetched, because this RWDBSelector was not executed previously. On //4, however, the result schema obtained during //3 is reused. This reuse may result in a performance increase.

For applications that work with tables whose schema may change while the program runs, schema caching should not be used.


Do not use schema caching for tables whose schema may change during runtime.

Using schema caching may result in undefined behavior if the schema of a database table being used changes while the program runs. By default, result schema caching is off since some applications work with tables whose schema may change.



Previous fileTop of DocumentContentsIndex pageNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and SourcePro, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.