diff options
author | Bernard Normier <bernard@zeroc.com> | 2007-02-01 17:09:49 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2007-02-01 17:09:49 +0000 |
commit | abada90e3f84dc703b8ddc9efcbed8a946fadead (patch) | |
tree | 2c6f9dccd510ea97cb927a7bd635422efaae547a /cpp/src/Freeze/TransactionI.cpp | |
parent | removing trace message (diff) | |
download | ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.bz2 ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.xz ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.zip |
Expanded tabs into spaces
Diffstat (limited to 'cpp/src/Freeze/TransactionI.cpp')
-rw-r--r-- | cpp/src/Freeze/TransactionI.cpp | 160 |
1 files changed, 80 insertions, 80 deletions
diff --git a/cpp/src/Freeze/TransactionI.cpp b/cpp/src/Freeze/TransactionI.cpp index ae8c4c7e2e4..c9920c7bfc0 100644 --- a/cpp/src/Freeze/TransactionI.cpp +++ b/cpp/src/Freeze/TransactionI.cpp @@ -30,46 +30,46 @@ Freeze::TransactionI::commit() long txnId = 0; try { - _connection->closeAllIterators(); + _connection->closeAllIterators(); - if(_txTrace >= 1) - { - txnId = (_txn->id() & 0x7FFFFFFF) + 0x80000000L; - } + if(_txTrace >= 1) + { + txnId = (_txn->id() & 0x7FFFFFFF) + 0x80000000L; + } - _txn->commit(0); + _txn->commit(0); - if(_txTrace >= 1) - { - Trace out(_connection->communicator()->getLogger(), "Freeze.Map"); - out << "committed transaction " << hex << txnId << dec; - } + if(_txTrace >= 1) + { + Trace out(_connection->communicator()->getLogger(), "Freeze.Map"); + out << "committed transaction " << hex << txnId << dec; + } } catch(const ::DbDeadlockException& dx) { - if(_txTrace >= 1) - { - Trace out(_connection->communicator()->getLogger(), "Freeze.Map"); - out << "failed to commit transaction " << hex << txnId << dec << ": " << dx.what(); - } - - cleanup(); - DeadlockException ex(__FILE__, __LINE__); - ex.message = dx.what(); - throw ex; + if(_txTrace >= 1) + { + Trace out(_connection->communicator()->getLogger(), "Freeze.Map"); + out << "failed to commit transaction " << hex << txnId << dec << ": " << dx.what(); + } + + cleanup(); + DeadlockException ex(__FILE__, __LINE__); + ex.message = dx.what(); + throw ex; } catch(const ::DbException& dx) { - if(_txTrace >= 1) - { - Trace out(_connection->communicator()->getLogger(), "Freeze.Map"); - out << "failed to commit transaction " << hex << txnId << dec << ": " << dx.what(); - } - - cleanup(); - DatabaseException ex(__FILE__, __LINE__); - ex.message = dx.what(); - throw ex; + if(_txTrace >= 1) + { + Trace out(_connection->communicator()->getLogger(), "Freeze.Map"); + out << "failed to commit transaction " << hex << txnId << dec << ": " << dx.what(); + } + + cleanup(); + DatabaseException ex(__FILE__, __LINE__); + ex.message = dx.what(); + throw ex; } cleanup(); } @@ -82,46 +82,46 @@ Freeze::TransactionI::rollback() long txnId = 0; try { - _connection->closeAllIterators(); + _connection->closeAllIterators(); - if(_txTrace >= 1) - { - txnId = (_txn->id() & 0x7FFFFFFF) + 0x80000000L; - } + if(_txTrace >= 1) + { + txnId = (_txn->id() & 0x7FFFFFFF) + 0x80000000L; + } - _txn->abort(); + _txn->abort(); - if(_txTrace >= 1) - { - Trace out(_connection->communicator()->getLogger(), "Freeze.Map"); - out << "rolled back transaction " << hex << txnId << dec; - } + if(_txTrace >= 1) + { + Trace out(_connection->communicator()->getLogger(), "Freeze.Map"); + out << "rolled back transaction " << hex << txnId << dec; + } } catch(const ::DbDeadlockException& dx) { - if(_txTrace >= 1) - { - Trace out(_connection->communicator()->getLogger(), "Freeze.Map"); - out << "failed to rollback transaction " << hex << txnId << dec << ": " << dx.what(); - } - - cleanup(); - DeadlockException ex(__FILE__, __LINE__); - ex.message = dx.what(); - throw ex; + if(_txTrace >= 1) + { + Trace out(_connection->communicator()->getLogger(), "Freeze.Map"); + out << "failed to rollback transaction " << hex << txnId << dec << ": " << dx.what(); + } + + cleanup(); + DeadlockException ex(__FILE__, __LINE__); + ex.message = dx.what(); + throw ex; } catch(const ::DbException& dx) { - if(_txTrace >= 1) - { - Trace out(_connection->communicator()->getLogger(), "Freeze.Map"); - out << "failed to rollback transaction " << hex << txnId << dec << ": " << dx.what(); - } - - cleanup(); - DatabaseException ex(__FILE__, __LINE__); - ex.message = dx.what(); - throw ex; + if(_txTrace >= 1) + { + Trace out(_connection->communicator()->getLogger(), "Freeze.Map"); + out << "failed to rollback transaction " << hex << txnId << dec << ": " << dx.what(); + } + + cleanup(); + DatabaseException ex(__FILE__, __LINE__); + ex.message = dx.what(); + throw ex; } cleanup(); } @@ -133,26 +133,26 @@ Freeze::TransactionI::TransactionI(ConnectionI* connection) : { try { - _connection->dbEnv()->getEnv()->txn_begin(0, &_txn, 0); - - if(_txTrace >= 1) - { - long txnId = (_txn->id() & 0x7FFFFFFF) + 0x80000000L; - Trace out(_connection->communicator()->getLogger(), "Freeze.Map"); - out << "started transaction " << hex << txnId << dec; - } + _connection->dbEnv()->getEnv()->txn_begin(0, &_txn, 0); + + if(_txTrace >= 1) + { + long txnId = (_txn->id() & 0x7FFFFFFF) + 0x80000000L; + Trace out(_connection->communicator()->getLogger(), "Freeze.Map"); + out << "started transaction " << hex << txnId << dec; + } } catch(const ::DbException& dx) { - if(_txTrace >= 1) - { - Trace out(_connection->communicator()->getLogger(), "Freeze.Map"); - out << "failed to start transaction: " << dx.what(); - } - - DatabaseException ex(__FILE__, __LINE__); - ex.message = dx.what(); - throw ex; + if(_txTrace >= 1) + { + Trace out(_connection->communicator()->getLogger(), "Freeze.Map"); + out << "failed to start transaction: " << dx.what(); + } + + DatabaseException ex(__FILE__, __LINE__); + ex.message = dx.what(); + throw ex; } } @@ -160,7 +160,7 @@ Freeze::TransactionI::~TransactionI() { if(_txn != 0) { - rollback(); + rollback(); } } |