diff -r 89d6a7a84779 -r 25a17d01db0c Symbian3/PDK/Source/GUID-1D836FB1-9BCA-53B5-8334-08CD59064227.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/PDK/Source/GUID-1D836FB1-9BCA-53B5-8334-08CD59064227.dita Fri Jan 22 18:26:19 2010 +0000 @@ -0,0 +1,12 @@ + + + + + +What are transactionsThis topic describes the purpose of transactions when accessing the Comms Database.

The CommsDat API provides the behaviour known as transactions. Tools and applications use transactions to make sure that read and write operations are consistent.

More than one application can use the Comms Database at the same time. Transactions implement a lock that allows applications to perform a set of read and write operations safely. In a transaction, other applications cannot change the data.

The CMDBSession class provides the functions that implement transactions.

You must create a session with the Comms Database before you start your first transaction.

A transaction starts with a call to CMDBSession::OpenTransactionL(), and ends with a call to CMDBSession::CommitTransactionL() or CMDBSession::RollbackTransactionL().

A call to CMDBSession::OpenTransactionL() starts a transaction.

A call to CMDBSession::CommitTransactionL() or CMDBSession::RollbackTransactionL() ends a transaction.

Between the start and end of a transaction, the CommsDat API makes sure that:

The CommsDat API cannot make other guarantees. Tools and applications must not make assumptions about the lock mechanism used by the implementation of the Comms Database.

Tools and applications must make sure that transactions are short. The Comms Database is a shared resource, and long transactions cause performance problems. The Comms Database implements a timeout to protect the database. The Comms Database can terminate very long transactions. The timeout does not affect the normal operation.

It is more efficient to wrap several write operations in one transaction, because data is only written to the Comms Database in a call to CMDBSession::CommitTransactionL(). Tools and applications must not hold a transaction open for longer than is necessary.

All read and write functions provided by MMetaDatabase use transactions internally and are consistent.

\ No newline at end of file