#include <database.h>
Public Types | |
enum | RestoreStatus { rsOK, rsCRCMismatch, rsReadFailed, rsTableNotFound, rsOIDMismatch } |
Public Member Functions | |
virtual bool | insert (dbTableDescriptor *table, oid_t oid, dbRecord const *dbsObj, void const *appObj) |
virtual bool | update (dbTableDescriptor *table, oid_t oid, dbRecord const *dbsObj, void const *appObj) |
virtual bool | remove (dbTableDescriptor *table, oid_t oid) |
virtual bool | commitPhase1 () |
virtual void | commitPhase2 () |
virtual void | rollback () |
bool | open (char_t const *path, int flags=dbFile::no_sync, bool crc=true) |
void | close () |
RestoreStatus | restore (dbDatabase &db, size_t &nTrans) |
Implementation of transaction logger wrting transaction into the file
void dbFileTransactionLogger::close | ( | ) |
Close transaction log
virtual bool dbFileTransactionLogger::commitPhase1 | ( | ) | [virtual] |
Perform first phase of transaction commit
Implements dbTransactionLogger.
virtual void dbFileTransactionLogger::commitPhase2 | ( | ) | [virtual] |
Perform second phase of transaction commit
Implements dbTransactionLogger.
virtual bool dbFileTransactionLogger::insert | ( | dbTableDescriptor * | table, | |
oid_t | oid, | |||
dbRecord const * | dbsObj, | |||
void const * | appObj | |||
) | [virtual] |
Insert new object
table | descriptor of table in which object is inserted | |
oid | object identifier | |
dbsObj | database (packed) object body | |
appObj | application object body |
Implements dbTransactionLogger.
bool dbFileTransactionLogger::open | ( | char_t const * | path, | |
int | flags = dbFile::no_sync , |
|||
bool | crc = true | |||
) |
Open transaction logger
path | path to the transaction log file | |
flags | dbFile::OpenFlags. Use dbFile::truncate flag to start new log | |
crc | whether to caclulate CRC for transaction body or not |
virtual bool dbFileTransactionLogger::remove | ( | dbTableDescriptor * | table, | |
oid_t | oid | |||
) | [virtual] |
Delete object
table | descriptor of table | |
oid | object identifier |
Implements dbTransactionLogger.
RestoreStatus dbFileTransactionLogger::restore | ( | dbDatabase & | db, | |
size_t & | nTrans | |||
) |
Restore trasnaction from this log
db | restored database | |
nTrans | number of restored transactions |
virtual void dbFileTransactionLogger::rollback | ( | ) | [virtual] |
Rollback transaction
Implements dbTransactionLogger.
virtual bool dbFileTransactionLogger::update | ( | dbTableDescriptor * | table, | |
oid_t | oid, | |||
dbRecord const * | dbsObj, | |||
void const * | appObj | |||
) | [virtual] |
Update object
table | descriptor of table | |
oid | object identifier | |
dbsObj | database (packed) object body | |
appObj | application object body |
Implements dbTransactionLogger.