class CommsDat::CMDBSession : public CBase |
A session with the underlying storage server
Public Member Functions | |
---|---|
~CMDBSession() | |
IMPORT_C TInt | CancelAllNotifications() |
IMPORT_C void | ClearAttributeMask(TMDBAttributeFlags) |
IMPORT_C void | Close() |
IMPORT_C void | CommitTransactionL() |
IMPORT_C TInt | IsInTransaction() |
IMPORT_C TBool | IsSetAttributeMask(TMDBAttributeFlags) |
IMPORT_C TVersion | LatestVersion() |
IMPORT_C CMDBSession * | NewL(TVersion) |
IMPORT_C CMDBSession * | NewLC(TVersion) |
IMPORT_C void | OpenTransactionL() |
IMPORT_C TInt | PublishProperties() |
IMPORT_C void | RollbackTransactionL() |
IMPORT_C void | SetAttributeMask(TMDBAttributeFlags) |
IMPORT_C TVersion | VersionInUse() |
Private Member Functions | |
---|---|
CMDBSession() | |
TInt | ConstructL(TVersion) |
Private Attributes | |
---|---|
CMDBSessionImpl * | iMDBSessionImpl |
IMPORT_C TInt | CancelAllNotifications | ( | ) |
Cancel all notification requests that are outstanding from calls to MMetaDatabase::RequestNotification Individual requests can be cancelled via MMetaDatabase::CancelNotify.
KErrNone on success or a system-wide error code
None
IMPORT_C void | ClearAttributeMask | ( | TMDBAttributeFlags | aAttributeFlags | ) |
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
None
TMDBAttributeFlags aAttributeFlags |
IMPORT_C void | Close | ( | ) |
Close session with storage server. v9.1 Destructor is all that is required
IMPORT_C void | CommitTransactionL | ( | ) |
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
None
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
TInt | ConstructL | ( | TVersion | aRequiredVersion | ) | [private] |
TVersion aRequiredVersion |
IMPORT_C TInt | IsInTransaction | ( | ) |
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. None
IMPORT_C TBool | IsSetAttributeMask | ( | TMDBAttributeFlags | aAttributeFlags | ) |
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
ETrue if the flag is set in the session mask This means that the attribute is ignored in database interactions for this session
EFalse if the flag is not set in the session mask This means that the attribute is obeyed in all database interactions for this session
None
TMDBAttributeFlags aAttributeFlags |
IMPORT_C TVersion | LatestVersion | ( | ) | [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.
None
None
IMPORT_C CMDBSession * | NewL | ( | TVersion | aRequiredVersion | ) | [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
None
on success a session has been created and initialised
TVersion aRequiredVersion |
IMPORT_C CMDBSession * | NewLC | ( | TVersion | aRequiredVersion | ) | [static] |
As NewL and adds Session to the CleanupStack
TVersion aRequiredVersion |
IMPORT_C void | OpenTransactionL | ( | ) |
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
None
on success the session has exclusive write access to the database
IMPORT_C TInt | PublishProperties | ( | ) |
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.
KErrNone on success. Otherwise a system-wide error code
None
IMPORT_C void | RollbackTransactionL | ( | ) |
Cancel Transaction with database and rollback all associated changes
leave
Will fail with KErrNotFound if not in transaction
None - though for correct usage, ensure a transaction is already open
Any open data containers may not be in sync with the database and should be discarded or reloaded
IMPORT_C void | SetAttributeMask | ( | TMDBAttributeFlags | aAttributeFlags | ) |
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
None
TMDBAttributeFlags aAttributeFlags |
IMPORT_C TVersion | VersionInUse | ( | ) |
Lookup data format version currently in use by client