version 1.5
OP Cache structure (connectionID; cacheStructure) Longint
Parameter | Type | Description | |
connectionID | Longint | Connection ID with target server | |
cacheStructure | Longint | Cache structure option (1=Yes) | |
Function result | Longint | Error code result for the function |
Description
If cacheStructure is not zero, OP Cache structure instructs 4D Open to start caching the 4D Server database structure for this connection (AND for all the other connections to this database) in the client machine's memory. In this case, ALL the routines that need structure information will use the cached information.
To stop caching the structure for a particular database, call OP Cache structure with cacheStructure equal to zero. Caching is off by default.
Caching is very useful for reducing requests sent over the network. However, this means that you expect to have a "frozen" database structure. Unlike the .rex file scheme, a change to the actual structure won't be reflected in the cached information. In addition, caching is local to a session; no structure information is kept on disk.
Before calling OP Cache structure, you must call OP Set option (3;1) to set "cache structure information" to on.
Error Codes
If OP Cache structure executes successfully, it returns 0. Otherwise, this function returns one of the following errors:
Error Code | Description |
10128 | The 4D Open for 4th Dimension package has not been initialized. |
10136 | The connection does not exist. |
10154 | This command cannot be executed right now. |
See Also