A version of this page is also available for
This function ends a transaction.
BOOL CeEndTransaction( HANDLE hSession, BOOL fCommit );
[in] Handle to the session. This handle must be returned from either the CeCreateSession (EDB) or the CeGetDatabaseSession (EDB) function.
[in] Specifies whether to commit the transaction. Specify TRUE to have all pending changes committed to the database. Specify FALSE to roll back all pending changes. If you specify TRUE, the committed changes are not flushed to disk until the flush interval has elapsed or until you call the CeFlushDBVol (EDB) function.
TRUE indicates success. FALSE indicates failure. To get extended error information, call GetLastError. The following table lists possible values.
The database is corrupted.
The hSession parameter is set to NULL or equal to INVALID_HANDLE_VALUE.
The session is not in a transaction.
This function fails if the session is not in a transaction. You must first call the CeBeginTransaction (EDB) function. When a transaction is running, all changes made to all databases using the same session are not committed or rolled back until this function is called. This function enables you to either commit and save all changes, or roll back and throw away all changes.
If changes are committed, they are not written to file until a flush occurs. The committed changes are cached until one of the following occurs:
The volume is explicitly flushed. For more information about explicitly flushing a volume, see CeFlushDBVol (EDB).
The FlushInterval parameter setting for the volume is reached.
The volume is unmounted.
Even if a transaction is committed, some locks may still be held in the database. To ensure that all locks are released, close the handle to the database.
|Windows Embedded CE||Windows CE 5.0 and later|
|Windows Mobile||Windows Mobile Version 5.0 and later|