ttRamPolicy

Description

Defines the policy used to determine when TimesTen loads the database specified by the connection string into the system RAM.

Required Privilege

Instance administrator

Syntax

ttRamPolicy (ttUtilHandle handle, const char* connStr,
             ttRamPolicyType policy)

Parameters

Parameter Type Description

handle

ttUtilHandle

Specifies the TimesTen utility library environment handle allocated using ttUtilAllocEnv.

connStr

const char*

This is a null-terminated string specifying a connection string that describes the database for which the RAM policy is to be set.

policy

ttRamPolicyType

Specifies the policy used to determine when TimesTen loads the specified database into system RAM. Valid values are the following:

  • TT_RAMPOL_ALWAYS: Specifies that the database should always remain in RAM.

  • TT_RAMPOL_MANUAL: Specifies that the database can be loaded into RAM explicitly using either the ttRamLoad C function or the ttAdmin -ramLoad command. Similarly, the database can be unloaded from RAM explicitly by using ttRamUnload C function or using ttAdmin -ramUnload command.

  • TT_RAMPOL_INUSE: Specifies that the database is to be loaded into RAM when an application wants to connect to the database. This RAM policy may be further modified using the ttRamGrace C function or using the ttAdmin -ramGrace command.

If you do not explicitly set the RAM policy for the specified database, the default RAM policy is TT_RAMPOL_INUSE.

Note: TT_RAMPOL_INUSE is not supported by TimesTen Scaleout.

Example

This example sets the RAM policy to manual for the payroll DSN.

ttUtilHandle   utilHandle;
int            rc;
rc = ttRamPolicy (utilHandle, "DSN=payroll", TT_RAMPOL_MANUAL);