Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: d32dbms.h
Link against: edbms.lib

Class RDbs

RDbs

Support

Supported from 5.0

Description

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.

Derivation

RDbsRepresents a session with the DBMS server
RHandleBaseHandle to an object
RSessionBaseClient-side handle to a session with a server

Defined in RDbs:
Connect(), ResourceCheck(), ResourceCount(), ResourceMark(), SetHeapFailure(), Version()

Inherited from RHandleBase:
Close(), Duplicate(), Handle(), SetHandle()

Inherited from RSessionBase:
Attach(), CreateSession(), EAutoAttach, EExplicitAttach, Send(), SendReceive(), SetRetry(), Share(), TAttachMode


Connecting to the DBMS server


Connect()

TInt Connect();

Description

Makes a connection with the DBMS server. This function causes the server to start, if it is not already running.

This 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.

Note that:

Return value

TInt

KErrNone if successful, otherwise another of the system-wide error codes.

[Top]


Information


Version()

static TVersion Version();

Description

Returns the version of the DBMS server.

Return value

TVersion

Version information.

[Top]


Utility functions for checking allocated DBMS objects


ResourceMark()

void ResourceMark();

Description

Marks 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.


ResourceCheck()

void ResourceCheck();

Description

Checks 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().


ResourceCount()

TInt ResourceCount();

Description

Returns the number of DBMS objects allocated in this session.

Return value

TInt

The number of DBMS allocated objects.

[Top]


Debugging support for the DBMS server heap


SetHeapFailure()

void SetHeapFailure(RHeap::TAllocFail aType,TInt aRate);

Description

Simulates a heap allocation failure in the DBMS server's heap.

The function behaves as described by User::__DbgSetAllocFail().

Note that this function has no effect if running with a release build of EUSER.DLL.

Parameters

RHeap::TAllocFail aType

An enumeration which indicates how to simulate allocation failure in the DBMS server's heap.

TInt aRate

The rate of failure. When aType is RHeap::EDeterministic, heap allocation fails every aRate attempts.

See also: