summaryrefslogtreecommitdiff
path: root/java/src/Freeze/TransactionI.java
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2011-03-30 10:51:07 -0700
committerMark Spruiell <mes@zeroc.com>2011-03-30 10:51:07 -0700
commitc28875d4c01935919396999852cb1c3f92c0fdbc (patch)
tree12f6b1cefe57d572121dcb47bd22b2f65dc3edff /java/src/Freeze/TransactionI.java
parent4986 - add constructor that takes Throwable (diff)
downloadice-c28875d4c01935919396999852cb1c3f92c0fdbc.tar.bz2
ice-c28875d4c01935919396999852cb1c3f92c0fdbc.tar.xz
ice-c28875d4c01935919396999852cb1c3f92c0fdbc.zip
4987 - preserve exception cause
Diffstat (limited to 'java/src/Freeze/TransactionI.java')
-rw-r--r--java/src/Freeze/TransactionI.java23
1 files changed, 5 insertions, 18 deletions
diff --git a/java/src/Freeze/TransactionI.java b/java/src/Freeze/TransactionI.java
index af0676bb466..8186b1ceb17 100644
--- a/java/src/Freeze/TransactionI.java
+++ b/java/src/Freeze/TransactionI.java
@@ -52,9 +52,7 @@ class TransactionI implements Transaction
e.getMessage());
}
- DeadlockException ex = new DeadlockException(_errorPrefix + "DbTxn.commit: " + e.getMessage(), this);
- ex.initCause(e);
- throw ex;
+ throw new DeadlockException(_errorPrefix + "DbTxn.commit: " + e.getMessage(), this, e);
}
catch(com.sleepycat.db.DatabaseException e)
{
@@ -65,10 +63,7 @@ class TransactionI implements Transaction
e.getMessage());
}
- DatabaseException ex = new DatabaseException();
- ex.initCause(e);
- ex.message = _errorPrefix + "DbTxn.commit: " + e.getMessage();
- throw ex;
+ throw new DatabaseException(_errorPrefix + "DbTxn.commit: " + e.getMessage(), e);
}
finally
{
@@ -123,9 +118,7 @@ class TransactionI implements Transaction
deadlock = true;
- DeadlockException ex = new DeadlockException(_errorPrefix + "DbTxn.abort: " + e.getMessage(), this);
- ex.initCause(e);
- throw ex;
+ throw new DeadlockException(_errorPrefix + "DbTxn.abort: " + e.getMessage(), this, e);
}
catch(com.sleepycat.db.DatabaseException e)
{
@@ -136,10 +129,7 @@ class TransactionI implements Transaction
e.getMessage());
}
- DatabaseException ex = new DatabaseException();
- ex.initCause(e);
- ex.message = _errorPrefix + "DbTxn.abort: " + e.getMessage();
- throw ex;
+ throw new DatabaseException(_errorPrefix + "DbTxn.abort: " + e.getMessage(), e);
}
finally
{
@@ -187,10 +177,7 @@ class TransactionI implements Transaction
"failed to start transaction: " + e.getMessage());
}
- DatabaseException ex = new DatabaseException();
- ex.initCause(e);
- ex.message = _errorPrefix + "txn_begin: " + e.getMessage();
- throw ex;
+ throw new DatabaseException(_errorPrefix + "txn_begin: " + e.getMessage(), e);
}
}