summaryrefslogtreecommitdiff
path: root/java/src/Freeze/TransactionI.java
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2007-02-01 17:09:49 +0000
committerBernard Normier <bernard@zeroc.com>2007-02-01 17:09:49 +0000
commitabada90e3f84dc703b8ddc9efcbed8a946fadead (patch)
tree2c6f9dccd510ea97cb927a7bd635422efaae547a /java/src/Freeze/TransactionI.java
parentremoving trace message (diff)
downloadice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.bz2
ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.xz
ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.zip
Expanded tabs into spaces
Diffstat (limited to 'java/src/Freeze/TransactionI.java')
-rwxr-xr-xjava/src/Freeze/TransactionI.java272
1 files changed, 136 insertions, 136 deletions
diff --git a/java/src/Freeze/TransactionI.java b/java/src/Freeze/TransactionI.java
index 7862216f0d5..7d4f7715661 100755
--- a/java/src/Freeze/TransactionI.java
+++ b/java/src/Freeze/TransactionI.java
@@ -14,156 +14,156 @@ class TransactionI extends Ice.LocalObjectImpl implements Transaction
public void
commit()
{
- String txnId = null;
-
- try
- {
- _connection.closeAllIterators();
-
- if(_txTrace >= 1)
- {
- txnId = Long.toHexString((_txn.getId() & 0x7FFFFFFF) + 0x80000000L);
- }
-
- _txn.commit();
-
- if(_txTrace >= 1)
- {
- _connection.communicator().getLogger().trace("Freeze.Map", _errorPrefix + "committed transaction " +
- txnId);
- }
- }
- catch(com.sleepycat.db.DeadlockException e)
- {
- if(_txTrace >= 1)
- {
- _connection.communicator().getLogger().trace("Freeze.Map", _errorPrefix +
- "failed to commit transaction " + txnId + ": " +
- e.getMessage());
- }
-
- DeadlockException ex = new DeadlockException();
- ex.initCause(e);
- ex.message = _errorPrefix + "DbTxn.commit: " + e.getMessage();
- throw ex;
- }
- catch(com.sleepycat.db.DatabaseException e)
- {
- if(_txTrace >= 1)
- {
- _connection.communicator().getLogger().trace("Freeze.Map", _errorPrefix +
- "failed to commit transaction " + txnId + ": " +
- e.getMessage());
- }
-
- DatabaseException ex = new DatabaseException();
- ex.initCause(e);
- ex.message = _errorPrefix + "DbTxn.commit: " + e.getMessage();
- throw ex;
- }
- finally
- {
- _connection.clearTransaction();
- _connection = null;
- _txn = null;
- }
+ String txnId = null;
+
+ try
+ {
+ _connection.closeAllIterators();
+
+ if(_txTrace >= 1)
+ {
+ txnId = Long.toHexString((_txn.getId() & 0x7FFFFFFF) + 0x80000000L);
+ }
+
+ _txn.commit();
+
+ if(_txTrace >= 1)
+ {
+ _connection.communicator().getLogger().trace("Freeze.Map", _errorPrefix + "committed transaction " +
+ txnId);
+ }
+ }
+ catch(com.sleepycat.db.DeadlockException e)
+ {
+ if(_txTrace >= 1)
+ {
+ _connection.communicator().getLogger().trace("Freeze.Map", _errorPrefix +
+ "failed to commit transaction " + txnId + ": " +
+ e.getMessage());
+ }
+
+ DeadlockException ex = new DeadlockException();
+ ex.initCause(e);
+ ex.message = _errorPrefix + "DbTxn.commit: " + e.getMessage();
+ throw ex;
+ }
+ catch(com.sleepycat.db.DatabaseException e)
+ {
+ if(_txTrace >= 1)
+ {
+ _connection.communicator().getLogger().trace("Freeze.Map", _errorPrefix +
+ "failed to commit transaction " + txnId + ": " +
+ e.getMessage());
+ }
+
+ DatabaseException ex = new DatabaseException();
+ ex.initCause(e);
+ ex.message = _errorPrefix + "DbTxn.commit: " + e.getMessage();
+ throw ex;
+ }
+ finally
+ {
+ _connection.clearTransaction();
+ _connection = null;
+ _txn = null;
+ }
}
public void
rollback()
{
- String txnId = null;
-
- try
- {
- _connection.closeAllIterators();
-
- if(_txTrace >= 1)
- {
- txnId = Long.toHexString((_txn.getId() & 0x7FFFFFFF) + 0x80000000L);
- }
-
- _txn.abort();
-
- if(_txTrace >= 1)
- {
- _connection.communicator().getLogger().trace("Freeze.Map", _errorPrefix + "rolled back transaction " +
- txnId);
- }
- }
- catch(com.sleepycat.db.DeadlockException e)
- {
- if(_txTrace >= 1)
- {
- _connection.communicator().getLogger().trace("Freeze.Map", _errorPrefix +
- "failed to rollback transaction " + txnId + ": " +
- e.getMessage());
- }
-
- DeadlockException ex = new DeadlockException();
- ex.initCause(e);
- ex.message = _errorPrefix + "DbTxn.abort: " + e.getMessage();
- throw ex;
- }
- catch(com.sleepycat.db.DatabaseException e)
- {
- if(_txTrace >= 1)
- {
- _connection.communicator().getLogger().trace("Freeze.Map", _errorPrefix +
- "failed to rollback transaction " + txnId + ": " +
- e.getMessage());
- }
-
- DatabaseException ex = new DatabaseException();
- ex.initCause(e);
- ex.message = _errorPrefix + "DbTxn.abort: " + e.getMessage();
- throw ex;
- }
- finally
- {
- _connection.clearTransaction();
- _connection = null;
- _txn = null;
- }
+ String txnId = null;
+
+ try
+ {
+ _connection.closeAllIterators();
+
+ if(_txTrace >= 1)
+ {
+ txnId = Long.toHexString((_txn.getId() & 0x7FFFFFFF) + 0x80000000L);
+ }
+
+ _txn.abort();
+
+ if(_txTrace >= 1)
+ {
+ _connection.communicator().getLogger().trace("Freeze.Map", _errorPrefix + "rolled back transaction " +
+ txnId);
+ }
+ }
+ catch(com.sleepycat.db.DeadlockException e)
+ {
+ if(_txTrace >= 1)
+ {
+ _connection.communicator().getLogger().trace("Freeze.Map", _errorPrefix +
+ "failed to rollback transaction " + txnId + ": " +
+ e.getMessage());
+ }
+
+ DeadlockException ex = new DeadlockException();
+ ex.initCause(e);
+ ex.message = _errorPrefix + "DbTxn.abort: " + e.getMessage();
+ throw ex;
+ }
+ catch(com.sleepycat.db.DatabaseException e)
+ {
+ if(_txTrace >= 1)
+ {
+ _connection.communicator().getLogger().trace("Freeze.Map", _errorPrefix +
+ "failed to rollback transaction " + txnId + ": " +
+ e.getMessage());
+ }
+
+ DatabaseException ex = new DatabaseException();
+ ex.initCause(e);
+ ex.message = _errorPrefix + "DbTxn.abort: " + e.getMessage();
+ throw ex;
+ }
+ finally
+ {
+ _connection.clearTransaction();
+ _connection = null;
+ _txn = null;
+ }
}
TransactionI(ConnectionI connection)
{
- _connection = connection;
- _txTrace = connection.txTrace();
- _errorPrefix = "Freeze DB DbEnv(\"" + _connection.envName() + "\"): ";
-
- try
- {
- _txn = _connection.dbEnv().getEnv().beginTransaction(null, null);
-
- if(_txTrace >= 1)
- {
- String txnId = Long.toHexString((_txn.getId() & 0x7FFFFFFF) + 0x80000000L);
-
- _connection.communicator().getLogger().trace("Freeze.Map", _errorPrefix + "started transaction " +
- txnId);
- }
- }
- catch(com.sleepycat.db.DatabaseException e)
- {
- if(_txTrace >= 1)
- {
- _connection.communicator().getLogger().trace("Freeze.Map", _errorPrefix +
- "failed to start transaction: " + e.getMessage());
- }
-
- DatabaseException ex = new DatabaseException();
- ex.initCause(e);
- ex.message = _errorPrefix + "txn_begin: " + e.getMessage();
- throw ex;
- }
+ _connection = connection;
+ _txTrace = connection.txTrace();
+ _errorPrefix = "Freeze DB DbEnv(\"" + _connection.envName() + "\"): ";
+
+ try
+ {
+ _txn = _connection.dbEnv().getEnv().beginTransaction(null, null);
+
+ if(_txTrace >= 1)
+ {
+ String txnId = Long.toHexString((_txn.getId() & 0x7FFFFFFF) + 0x80000000L);
+
+ _connection.communicator().getLogger().trace("Freeze.Map", _errorPrefix + "started transaction " +
+ txnId);
+ }
+ }
+ catch(com.sleepycat.db.DatabaseException e)
+ {
+ if(_txTrace >= 1)
+ {
+ _connection.communicator().getLogger().trace("Freeze.Map", _errorPrefix +
+ "failed to start transaction: " + e.getMessage());
+ }
+
+ DatabaseException ex = new DatabaseException();
+ ex.initCause(e);
+ ex.message = _errorPrefix + "txn_begin: " + e.getMessage();
+ throw ex;
+ }
}
com.sleepycat.db.Transaction
dbTxn()
{
- return _txn;
+ return _txn;
}
private ConnectionI _connection;