|Oracle 8i Data Cartridge Developer's Guide
Release 2 (8.1.6)
Part Number A76937-01
Using Cartridge Services, 5 of 9
Context management allows the clients to store values across calls. Cartridge services provide a mechanism for saving and restoring context.
Most operating systems which support threads have the concept of thread context. Threads can store thread specific data in this context (or state) and retrieve it at any point. This provides a notion of thread global variable. Typically a pointer which points to the root of a structure is stored in the context.
When the row source mechanism is externalized, you will need a mechanism to maintain state between multiple calls to the same row source.
There is a need to maintain session, statement and process states. Session state includes information about multiple statements that are open, message files based on sessions NLS settings etc. Process state includes shared metadata, (this can also be system wide shared), message files etc. Depending on whether the cartridge application is truly multi threaded, information sharing can be at a process level or system level.
Since a user can be using multiple cartridges at any time, the state that is maintained has to be per cartridge. This is implemented by requiring the user to supply a key for each duration.
There are various predefined types of durations supported on memory and context management calls. An additional parameter in all these calls is a context.