
BeginTransaction
BeginTransaction primes the database to a usable state.unsigned __int64 BeginTransaction ( enum CODBPP::Mode mode = CODBPP::SHARED, unsigned int milliseconds = 60000 );
Parameters
| mode | vaild modes are CODBPP::SHARED xor CODBPP::EXCLUSIVE xor CODBPP::LOCK_FREE. |
| milliseconds | is the time that ObjectDatabase++ will try to start the transaction before giving up and returning |
Return Values
If the method succeeds, the return value is zero else see error codes for more details.Remarks
- Some methods require the transaction mode to be CODBPP::EXCLUSIVE.
Example Use
- C++
#include "ODBPP.h"
int wmain(int argc, wchar_t* argv[])
{
unsigned __int64 error;
const char16_t *message;
CODBPP database;
if((error = database.OpenDatabase(u"YourDatabase")) == NO_ERROR){
if((error = database.BeginTransaction()) == NO_ERROR){
...
}
if(error && database.GetErrorMessage(&message) == NO_ERROR)
MessageBox(message);
database.EndTransaction();
}
database.CloseDatabase();
return NO_ERROR;
}Also See
AbortTransaction, CommitTransaction, EndTransactionListen All
Comments (0)

