![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Section Contents
Applications that use this class will not work correctly on a version of EPOC earlier than ER5.
RHandleBase |
Abstract: handle to an object |
RSessionBase |
Abstract: base class for handle to a session |
RDbs |
Session with the DBMS server. |
d32dbms.h
edbms.lib
This class represents a session with the DBMS server. A thread uses this class to set up a DBMS server session and this provides the basis for sharing databases with other threads.
TInt Connect();
Use this function to make a connection with the DBMS server. This function causes the server to start, if it is not already running.
Connect() should be the first function called on an RDbs object after it is created.
Once a connection has been established, databases can be opened through the server.
TInt |
KErrNone if successful or one of the system error codes: see system error codes. |
Threads can make any number of simultaneous connections to the DBMS server.
The session must stay open until all DBMS objects opened through the server have been closed.
The session is terminated by calling the Close() member function provided by the RHandleBase class.
static TVersion Version();
Use this function to return the version of the DBMS server.
TVersion |
The object containing the version information. |
void ResourceMark();
Use this function to mark the start point for checking the number of DBMS objects allocated in this session.
The function takes the current number of allocated DBMS objects as its benchmark number.
A call to this function is normally followed by a later call to ResourceCheck() which expects that the number of allocated DBMS objects to be the same as this benchmark number.
void ResourceCheck();
Use this function to check that the number of DBMS objects allocated in this session is the same as the benchmark number recorded by an earlier call to ResourceMark().
The function raises a CSession 2 panic if the current number of DBMS objects is not the same as that recorded by an earlier call to ResourceMark().
TInt ResourceCount();
Use this function to return the number of DBMS objects allocated in this session.
TInt |
The number of DBMS allocated objects. |
void SetHeapFailure(RHeap::TAllocFail aType,TInt aRate);
Use this function to simulate a heap allocation failure in the DBMS server's heap.
The function behaves as described by the __DbgSetAllocFail() member function of the User class.
RHeap::TAllocFail aType |
An enumeration which indicates how to simulate allocation failure in the DBMS server's heap. This is one of: RHeap::EFailNext - the next attempt to allocate from the heap fails. RHeap::ERandom - attempts to allocate from the heap fail at a random rate; however, the interval pattern between failures is the same every time simulation is started. RHeap::ETrueRandom - attempts to allocate from the heap fail at a random rate. The interval pattern between failures may be different every time simulation is started. RHeap::EDeterministic - attempts to allocate from the heap fail at a rate aRate; for example, if aRate is 3, allocation fails at every third attempt. RHeap::ENone - cancels simulated heap allocation failure. |
TInt aRate |
The rate of failure; |
The function has no effect if running with a release build of EUSER.DLL
.
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |