CeEndTransaction (EDB) (Windows CE 5.0)

Send Feedback

This function is used to end a transaction.

This function does not work with CEDB databases. For more information about CEDB, see CEDB Reference.

BOOL CeEndTransaction(HANDLEhSession,BOOLfCommit);

Parameters

  • hSession
    [in] A handle to the session. This handle must be returned from either the CeCreateSession (EDB) or the CeGetDatabaseSession (EDB) function.
  • fCommit
    [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 won't actually be flushed to disk until the flush interval has elapsed, or until you call the CeFlushDBVol (EDB) function.

Return Values

TRUE indicates success. FALSE indicates failure. To get extended error information, call GetLastError. The following table lists possible values returned by GetLastError:

Return Value Description
ERROR_NOT_FOUND Indicates that the session is not in a transaction.
ERROR_INVALID_HANDLE Indicates that hSession is NULL or equal to INVALID_HANDLE_VALUE.

Remarks

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 allows the caller to either commit and save all the changes, or roll back and throw away all of the 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 setting for the volume is reached.

  • The volume is unmounted.

    Note   Even if a transaction is committed, some locks may still be held in the database. To ensure that all locks are released, you must close the handle to the database.

Requirements

OS Versions: Windows CE 5.0 and later.
Header: Windbase.h.
Link Library: Coredll.lib..

See Also

CeCreateSession (EDB) | CeGetDatabaseSession (EDB) | CeBeginTransaction (EDB) | CeFlushDBVol (EDB)

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.