Symisc UnQLite

An Embeddable NoSQL Database Engine



UnQLite C/C++ API Reference - Transaction Manager.

Syntax

int unqlite_rollback(unqlite *pDb);


Rollback a write-transaction on the specified database handle.


Description


If a write transaction is open, then all changes made within the transaction are reverted and the current write-transaction is closed (Dropping all exclusive locks on the target database, deletion of the journal file, etc.). Otherwise this routine is a no-op.


Parameters


pDb

A pointer to a unQLite Database Handle.


Return value


UNQLITE_OK is returned on success. Any other return value indicates failure such as:


UNQLITE_READ_ONLY: Read-only database.


UNQLITE_BUSY: Another thread or process have an exclusive lock on the database. In this case, the caller should wait until the lock holder relinquish it.


UNQLITE_IOERR: OS specific error.


UNQLITE_NOMEM: Out of memory (An unlikely scenario).


UNQLITE_ABORT: Another thread have released the database handle.


For a human-readable error message, you can extract the database error log via unqlite_config() with a configuration verb set to UNQLITE_CONFIG_ERR_LOG.


See also


unqlite_commit, unqlite_begin, unqlite_open, unqlite_close, unqlite_config.



Symisc Systems
Copyright © Symisc Systems