CommsDat::CMDBSession Class Reference

class CommsDat::CMDBSession : public CBase

A session with the underlying storage server

Inherits from

  • CommsDat::CMDBSession

Constructor & Destructor Documentation

CMDBSession()

CMDBSession()[private]

~CMDBSession()

IMPORT_C~CMDBSession()

Virtual Destructor

Member Functions Documentation

CancelAllNotifications()

IMPORT_C TIntCancelAllNotifications()

Cancel all notification requests that are outstanding from calls to MMetaDatabase::RequestNotification Individual requests can be cancelled via MMetaDatabase::CancelNotify.

Pre-condition
None

ClearAttributeMask(TMDBAttributeFlags)

IMPORT_C voidClearAttributeMask(TMDBAttributeFlagsaAttributeFlags)

Clear attribute mask settings, indicating required access level to stored data Clear flags in the attribute mask for this session

Flags indicate the requested access level to stored data

Attribute flags that have been set in this function will be cleared from the session's attribute mask and will be obeyed as restrictions in all database interactions, providing the client has enough platform security capabilities to back up the request

Pre-condition
None

Parameters

TMDBAttributeFlags aAttributeFlags

Close()

IMPORT_C voidClose()

Close session with storage server. v9.1 Destructor is all that is required

CommitTransactionL()

IMPORT_C voidCommitTransactionL()

Commit Transaction in database.

leave
Will leave with KErrNotFound if not in transaction
leave
Will leave with a system-wide error code if an error occurs during commit
Pre-condition
None
Post-condition
On success the database is updated with data added, modified or deleted during the transaction
On failure, any open data containers may not be in sync with the database and should be discarded or reloaded

ConstructL(TVersion)

TInt ConstructL(TVersionaRequiredVersion)[private]

Parameters

TVersion aRequiredVersion

IsInTransaction()

IMPORT_C TIntIsInTransaction()
Query if this session is in a transaction with the database Return code will indicate Not in transaction, Already in transaction for this session, Write-lock not available. Another session has it.
Pre-condition
None

IsSetAttributeMask(TMDBAttributeFlags)

IMPORT_C TBoolIsSetAttributeMask(TMDBAttributeFlagsaAttributeFlags)

Check flags in attribute mask aAttributeFlags indicates the requested access level to stored data Attribute flags that have been set will be ignored as restrictions in all database interactions, providing the client has enough platform security capabilities to back up the request

Pre-condition
None

Parameters

TMDBAttributeFlags aAttributeFlags

LatestVersion()

IMPORT_C TVersionLatestVersion()[static]

Returns the KCDCurrentVersion constant which maps to the KCDVersion1_1 constant for backward compatibility reason. Please avoid using this method when creating a CommsDat session object and use explicit schema version instead.

Pre-condition
None
Post-condition
None

NewL(TVersion)

IMPORT_C CMDBSession *NewL(TVersionaRequiredVersion)[static]

Open a session with the storage server and establish data format version in use CommsDat always attempts to support the required version of the client-facing data set. The client must carefully choose the dataset version as it affects binary compatibility

aRequiredVersion If the requested version is deprecated but still supported, mapping will be performed within CommsDat to maintain Data and Binary compatibility for the client If the requested version is the latest version, no mapping will be performed and deprecated fields will be ignored A client that needs to maintain BC must use a specific version A client that always wants to use the latest dataset can start the session with KCDLatestVersion

leave
KErrUnsupported If an old unsupported version is requested
leave
System-wide error codes if there is an unexpected error
Pre-condition
None
Post-condition
on success a session has been created and initialised

Parameters

TVersion aRequiredVersion

NewLC(TVersion)

IMPORT_C CMDBSession *NewLC(TVersionaRequiredVersion)[static]

As NewL and adds Session to the CleanupStack

Parameters

TVersion aRequiredVersion

OpenTransactionL()

IMPORT_C voidOpenTransactionL()

Open Transaction with storage server and obtain write lock - if not already set

capability
WriteDeviceData
leave
Will leave with KErrNotAvailable if Database write locked by another process
leave
Will report KErrAlreadyInTransaction if transaction this session is already in a transaction
leave
Will leave with a system-wide error code if an error occurs during commit
Pre-condition
None
Post-condition
on success the session has exclusive write access to the database

PublishProperties()

IMPORT_C TIntPublishProperties()

Attempt to create publish/subscribe properties if not already defined.

This function is normally called as a setup activity by System components

capability
WriteDeviceData - since these properties are created in KUidSystemCategory category.
Pre-condition
None

RollbackTransactionL()

IMPORT_C voidRollbackTransactionL()

Cancel Transaction with database and rollback all associated changes

leave
Will fail with KErrNotFound if not in transaction
Pre-condition
None - though for correct usage, ensure a transaction is already open
Post-condition
Any open data containers may not be in sync with the database and should be discarded or reloaded

SetAttributeMask(TMDBAttributeFlags)

IMPORT_C voidSetAttributeMask(TMDBAttributeFlagsaAttributeFlags)

Set attributes to ignore for all database operations during this session

aAttributeFlags indicates the requested access level to stored data. Attributes set by this call will be ignored as restrictions in all database interactions, providing the client has enough platform security capabilities to back up the request

Pre-condition
None

Parameters

TMDBAttributeFlags aAttributeFlags

VersionInUse()

IMPORT_C TVersionVersionInUse()

Lookup data format version currently in use by client

Member Data Documentation

CMDBSessionImpl * iMDBSessionImpl

CMDBSessionImpl *iMDBSessionImpl[private]