added: to DbBase:
bool EndTrans(bool everything_ok); git-svn-id: svn://ttmath.org/publicrep/winix/trunk@873 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
parent
e739f30088
commit
cc71c225a3
|
@ -429,6 +429,25 @@ Error DbBase::CommitTrans()
|
|||
|
||||
|
||||
|
||||
bool DbBase::EndTrans(bool everything_ok)
|
||||
{
|
||||
bool result;
|
||||
|
||||
if( everything_ok )
|
||||
{
|
||||
result = (CommitTrans() == WINIX_ERR_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
RollbackTrans();
|
||||
// we return the old err code
|
||||
result = false;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Error DbBase::EndTrans(Error err)
|
||||
{
|
||||
if( err == WINIX_ERR_OK )
|
||||
|
|
|
@ -72,6 +72,9 @@ public:
|
|||
Error CommitTrans();
|
||||
Error EndTrans(Error err);
|
||||
|
||||
// new API (returns only bool)
|
||||
bool EndTrans(bool everything_ok);
|
||||
|
||||
static void UnescapeBin(const char * str, size_t len, std::string & out, bool clear_out = true);
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue