RDbs Class Reference

class RDbs : public RSessionBase

Client-server databases

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.

Inherits from

Public Member Functions
IMPORT_C CDbStrings *BackupPathsL(TSecureId, TUid)
IMPORT_C CDbDatabaseNames *DatabaseNamesL(TDriveNumber, TUid)
IMPORT_C TIntDeleteDatabase(const TDesC &, TUid)
IMPORT_C TIntGetBackupPath(TSecureId, const TDesC &, TUid, TDes &)
IMPORT_C TIntGetDatabasePolicy(TUid, TPolicyType, TSecurityPolicy &)
IMPORT_C TIntGetReserveAccess(TInt)
IMPORT_C TIntGetTablePolicies(TUid, const TDesC &, TPolicyType, TSecurityPolicy &, TSecurityPolicy &)
IMPORT_C TIntGetTablePolicy(TUid, const TDesC &, TPolicyType, TSecurityPolicy &)
IMPORT_C TIntReleaseReserveAccess(TInt)
IMPORT_C TIntReserveDriveSpace(TInt, TInt)
IMPORT_C TIntResourceCount()
IMPORT_C voidResourceMark()
IMPORT_C voidSetHeapFailure(TInt, TInt)
IMPORT_C TVersionVersion()
Private Member Functions
TInt DoConnect()
TInt GetPolicy(TUid, const TDesC &, TUint, TSecurityPolicy &)
TInt SessionMessage(TInt)
Inherited Functions
RHandleBase::Attributes()const
RHandleBase::BTraceId()const
RHandleBase::Close()
RHandleBase::DoExtendedClose()
RHandleBase::Duplicate(const RThread &,TOwnerType)
RHandleBase::FullName()const
RHandleBase::FullName(TDes &)const
RHandleBase::Handle()const
RHandleBase::HandleInfo(THandleInfo *)
RHandleBase::Name()const
RHandleBase::NotifyDestruction(TRequestStatus &)
RHandleBase::Open(const TFindHandleBase &,TOwnerType)
RHandleBase::OpenByName(const TDesC &,TOwnerType,TInt)
RHandleBase::RHandleBase()
RHandleBase::RHandleBase(TInt)
RHandleBase::SetHandle(TInt)
RHandleBase::SetHandleNC(TInt)
RSessionBase::CreateSession(RServer2,const TVersion &)
RSessionBase::CreateSession(RServer2,const TVersion &,TInt)
RSessionBase::CreateSession(RServer2,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)
RSessionBase::CreateSession(const TDesC &,const TVersion &)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt,TIpcSessionType,const TSecurityPolicy *,TRequestStatus *)
RSessionBase::CreateSession(const TDesC &,const TVersion &,TInt,TRequestStatus *)
RSessionBase::Open(RMessagePtr2,TInt,TOwnerType)
RSessionBase::Open(RMessagePtr2,TInt,const TSecurityPolicy &,TOwnerType)
RSessionBase::Open(TInt,TOwnerType)
RSessionBase::Open(TInt,const TSecurityPolicy &,TOwnerType)
RSessionBase::Send(TInt)const
RSessionBase::Send(TInt,const TIpcArgs &)const
RSessionBase::SendReceive(TInt)const
RSessionBase::SendReceive(TInt,TRequestStatus &)const
RSessionBase::SendReceive(TInt,const TIpcArgs &)const
RSessionBase::SendReceive(TInt,const TIpcArgs &,TRequestStatus &)const
RSessionBase::SetReturnedHandle(TInt)
RSessionBase::SetReturnedHandle(TInt,RHandleBase &)
RSessionBase::SetReturnedHandle(TInt,const TSecurityPolicy &)
RSessionBase::ShareAuto()
RSessionBase::ShareProtected()
Public Member Enumerations
enumTPolicyType { EReadPolicy, EWritePolicy, ESchemaPolicy }
Inherited Enumerations
RHandleBase:TAttributes
RSessionBase:TAttachMode
Inherited Attributes
RHandleBase::iHandle

Member Functions Documentation

BackupPathsL(TSecureId, TUid)

IMPORT_C CDbStrings *BackupPathsL(TSecureIdaRequesterSid,
TUidaDbPolicyUid
)

Parameters

TSecureId aRequesterSid
TUid aDbPolicyUid

DatabaseNamesL(TDriveNumber, TUid)

IMPORT_C CDbDatabaseNames *DatabaseNamesL(TDriveNumberaDrive,
TUidaPolicyUid
)

Retrieves a list of names of secure shared databases, which share the same security policy, as determined by the supplied UID. If a database name is longer than KDbMaxName, it will not be added to the list.

leave
KErrNoMemory - not enough memory for the operation to be done
leave
KErrArgument - invalid UID parameter (including KNullUid value)
leave
KErrBadName - invalid drive number (not in A-Z range)
leave
KErrNotReady - the drive is not presented in the system
leave
Some other system-wide error codes

Parameters

TDriveNumber aDriveThe drive number to be searched.
TUid aPolicyUidDatabase security policy UID.

DeleteDatabase(const TDesC &, TUid)

IMPORT_C TIntDeleteDatabase(const TDesC &aDbName,
TUidaPolicyUid
)

Deletes an existing secure shared database.

capability
Note For a secure shared database, the caller must satisfy the schema access policy for the database.

Parameters

const TDesC & aDbNameSource database name (<drive>:<name>.<ext> format)
TUid aPolicyUidDatabase security policy UID.

DoConnect()

TInt DoConnect()[private]

GetBackupPath(TSecureId, const TDesC &, TUid, TDes &)

IMPORT_C TIntGetBackupPath(TSecureIdaRequesterSid,
const TDesC &aDbName,
TUidaDbPolicyUid,
TDes &aBackupPath
)

The method will fill out aBackupPath argument with the full path of aDbName secure shared database.

Parameters

TSecureId aRequesterSidSecurity ID of the process which is supposed to backup or restore the database. 0 or ECapability_None are invalid values for aRequesterSID parameter.
const TDesC & aDbNameSecure shared database name, which path will be set in aBackupPath parameter. The name's format is <drive>:<name>.<ext>
TUid aDbPolicyUidDatabase security policy UID.
TDes & aBackupPathAn output parameter. After a successfull call, the DBMS server will fill out the full database path there. aBackupPath must offer enough space to get the whole database path. Probably the best aBackupPath length is KMaxPath value.

GetDatabasePolicy(TUid, TPolicyType, TSecurityPolicy &)

IMPORT_C TIntGetDatabasePolicy(TUidaPolicyUid,
TPolicyTypeaPolicyType,
TSecurityPolicy &aDbPolicy
)

Returns in the aDbPolicy output parameter the requested database security policy of type aPolicyType.

Parameters

TUid aPolicyUidDatabase security policy UID.
TPolicyType aPolicyTypePolicy type: EReadPolicy, EWritePolicy, ESchemaPolicy.
TSecurityPolicy & aDbPolicyIt will be initialized with the requested security policy data after a successfull call.

GetPolicy(TUid, const TDesC &, TUint, TSecurityPolicy &)

TInt GetPolicy(TUidaPolicyUid,
const TDesC &aTableName,
TUintaMask,
TSecurityPolicy &aPolicy
)[private]

Returns in aPolicy output parameter requested database/table security policy of type aPolicyType.

Parameters

TUid aPolicyUidDatabase security policy UID
const TDesC & aTableNameTable name.
TUint aMaskBit-field: it includes ther policy type: EReadPolicy, EWritePolicy, ESchemaPolicy and the request type - database or table.
TSecurityPolicy & aPolicyIt will be initialized with the requested security policy data after a successfull call.

GetReserveAccess(TInt)

IMPORT_C TIntGetReserveAccess(TIntaDriveNo)

Grants access to a given area on a given drive for RDbs session. Note this session must have reserved space on this particular drive in order to be granted access to the reserved area.

RFs::GetReserveAccess()

Parameters

TInt aDriveNoDrive number with a reserved disk space, an access to which is requested.

GetTablePolicies(TUid, const TDesC &, TPolicyType, TSecurityPolicy &, TSecurityPolicy &)

IMPORT_C TIntGetTablePolicies(TUidaPolicyUid,
const TDesC &aTableName,
TPolicyTypeaPolicyType,
TSecurityPolicy &aDbPolicy,
TSecurityPolicy &aTablePolicy
)

Returns in the aDbPolicy and aTablePolicy output parameters the requested database and table security policies of type aPolicyType.

Parameters

TUid aPolicyUidDatabase security policy UID.
const TDesC & aTableNameTable name.
TPolicyType aPolicyTypePolicy type: EReadPolicy, EWritePolicy.
TSecurityPolicy & aDbPolicyIt will be initialized with the requested security policy data after a successfull call.
TSecurityPolicy & aTablePolicyIt will be initialized with the requested security policy data after a successfull call.

GetTablePolicy(TUid, const TDesC &, TPolicyType, TSecurityPolicy &)

IMPORT_C TIntGetTablePolicy(TUidaPolicyUid,
const TDesC &aTableName,
TPolicyTypeaPolicyType,
TSecurityPolicy &aTablePolicy
)

Returns in the aTablePolicy output parameter the requested table security policy of type aPolicyType.

Parameters

TUid aPolicyUidDatabase security policy UID.
const TDesC & aTableNameTable name.
TPolicyType aPolicyTypePolicy type: EReadPolicy, EWritePolicy.
TSecurityPolicy & aTablePolicyIt will be initialized with the requested security policy data after a successfull call.

ReleaseReserveAccess(TInt)

IMPORT_C TIntReleaseReserveAccess(TIntaDriveNo)

Revokes access on a given drive for RDbs session.

panic
In debug mode there will be a panic with the line number as an error code if there is no reserved disk space for aDrive.
panic
In debug mode there will be a panic with the line number as an error code if there is no granted access to the reserved disk space.

Parameters

TInt aDriveNoDrive number with a reserved disk space, the access to which has to be released.

ReserveDriveSpace(TInt, TInt)

IMPORT_C TIntReserveDriveSpace(TIntaDriveNo,
TIntaSpace
)

Reserves a prederfined amount of disk space on aDrive drive. At the moment the max possible amount, allowed by the file server, is reserved on aDrive drive.

Use this call to ensure that if your "delete records" transaction fails because of "out of disk space" circumstances, you can get an access to the already reserved disk space and complete your transaction successfully the second time.

There is no strong, 100% guarantee, that the reserved disk space will always help the client in "low memory" situations.

RFs::ReserveDriveSpace()

Parameters

TInt aDriveNoDrive number to reserve space on
TInt aSpaceThis parameter is not used at the moment. The caller shall set it to 0.

ResourceCount()

IMPORT_C TIntResourceCount()

Returns the number of DBMS objects allocated in this session.

ResourceMark()

IMPORT_C voidResourceMark()

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.

SessionMessage(TInt)

TInt SessionMessage(TIntaFunction)[private]

Parameters

TInt aFunction

SetHeapFailure(TInt, TInt)

IMPORT_C voidSetHeapFailure(TIntaTAllocFail,
TIntaRate
)

Parameters

TInt aTAllocFail
TInt aRate

Version()

IMPORT_C TVersionVersion()[static]

Returns the version of the DBMS server.

Member Enumerations Documentation

Enum TPolicyType

This enum is used in GetDatabasePolicy/GetTablePolicy/GetTablePolicies calls and specifies requested security policy type: read/write/schema.

Enumerators

EReadPolicy
EWritePolicy
ESchemaPolicy