Consultor Eletrônico



Kbase 20699: How to Use SAVE CACHE statement and the "-cache" parameter.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   22/01/2010
Status: Verified

GOAL:

How to use the SAVE CACHE statement and "-cache" parameter.

GOAL:

What is the purpose of the SAVE CACHE statement?

GOAL:

What is -cache parameter used for?

FIX:

The SAVE CACHE statement and the "-cache" parameter are often used when database connections are made across a wide area network (WAN). The SAVE CACHE and "?cache" parameter reduces the amount of network calls the Progress client will make to the database.

When a client initiates database activity, the Progress client reads the database schema from a database file that resides on disk. After reading the schema from disk the client saves a copy of the database schema (called the schema cache) in its local memory pool.
The time taken to build this schema cache is minimal, but when connections are established across a WAN, or when several clients connect to the database simultaneously, use of the "-cache" parameter can increase connection performance.

The "-cache" parameter forces the client to read the database schema from a local file to the client instead of across the WAN from the database file. In order to use the "?cache" parameter a binary file with the database schema stored in it is created. The schema cache stored in this binary file must be valid against the database it is used. Progress validates the information in the binary file by checking the time stamp of the cache file and the database master block. If the time stamps do not match you can get and error.


To create the cache file, run the following statement:

SAVE CACHE {CURRENT|COMPLETE} {database-name|VALUE(char-expr)} TO pathname|VALUE(char-expr)} [NO-ERROR]

For example:

save cache COMPLETE "sports" to "d:\sports.csh".

When working with DataServer, make sure you are connected to both the SCHEMA HOLDER and the Non-Progress DataSource.

To use the cache file with connection parameters use the following syntax:

-cache filename

For example:

-db d:\wrk83b\sports -1 -cache d:\sports.csh

When working with DataServer, place the "-cache", parameter with the SCHEMA HOLDER connection string (which is before the schema image connection string).

To use several cache files when several databases are being connected, you can build a .pf file:

For example:

dbs.pf

-db msg -S pscmsg -H myserver -cache d:\msg.csh
-db d:\wrk83b\sports -1 -cache d:\sports.csh