BeginTransaction
BeginTransaction primes the database to a usable state.
unsigned int 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
CODBPP database;
if((error = database.OpenDatabase("YourDatabase")) == NO_ERROR){
if((error = database.BeginTransaction()) == NO_ERROR{
...
}
if(error && database.GetErrorMessage(&message) == NO_ERROR)
MessageBox(message);
database.EndTransaction();
}
database.CloseDatabase();
Also See
AbortTransaction,
CommitTransaction, EndTransaction
Copyright © 2003-2007, Ekky Software.