diff options
Diffstat (limited to 'java/src/Freeze/DBTransactionI.java')
-rw-r--r-- | java/src/Freeze/DBTransactionI.java | 128 |
1 files changed, 0 insertions, 128 deletions
diff --git a/java/src/Freeze/DBTransactionI.java b/java/src/Freeze/DBTransactionI.java deleted file mode 100644 index 1e31ad9a13a..00000000000 --- a/java/src/Freeze/DBTransactionI.java +++ /dev/null @@ -1,128 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003 -// ZeroC, Inc. -// Billerica, MA, USA -// -// All Rights Reserved. -// -// Ice is free software; you can redistribute it and/or modify it under -// the terms of the GNU General Public License version 2 as published by -// the Free Software Foundation. -// -// ********************************************************************** - -package Freeze; - -class DBTransactionI extends Ice.LocalObjectImpl implements DBTransaction -{ - public synchronized void - commit() - { - if(_tid == null) - { - String s = _errorPrefix + "transaction has already been committed or aborted"; - DBException ex = new DBException(); - ex.message = s; - throw ex; - } - - if(_trace >= 2) - { - _communicator.getLogger().trace("DB", "committing transaction for environment \"" + _name + "\""); - } - - try - { - _tid.commit(0); - } - catch(com.sleepycat.db.DbDeadlockException e) - { - DBDeadlockException ex = new DBDeadlockException(); - ex.initCause(e); - ex.message = _errorPrefix + "DbTxn.commit: " + e.getMessage(); - throw ex; - } - catch(com.sleepycat.db.DbException e) - { - DBException ex = new DBException(); - ex.initCause(e); - ex.message = _errorPrefix + "DbTxn.commit: " + e.getMessage(); - throw ex; - } - - _tid = null; - } - - public synchronized void - abort() - { - if(_tid == null) - { - String s = _errorPrefix + "transaction has already been committed or aborted"; - DBException ex = new DBException(); - ex.message = s; - throw ex; - } - - if(_trace >= 2) - { - _communicator.getLogger().trace("DB", "aborting transaction for environment \"" + _name + - "\" due to deadlock"); - } - - try - { - _tid.abort(); - } - catch(com.sleepycat.db.DbException e) - { - DBException ex = new DBException(); - ex.initCause(e); - ex.message = _errorPrefix + "DbTxn.abort: " + e.getMessage(); - throw ex; - } - - _tid = null; - } - - com.sleepycat.db.DbTxn - getTxnId() - { - return _tid; - } - - - DBTransactionI(Ice.Communicator communicator, com.sleepycat.db.DbEnv dbEnv, String name) - { - _communicator = communicator; - _name = name; - _errorPrefix = "Freeze::DBTransaction(\"" + _name + "\"): "; - _trace = _communicator.getProperties().getPropertyAsInt("Freeze.Trace.DB"); - - if(_trace >= 2) - { - _communicator.getLogger().trace("DB", "starting transaction for environment \"" + _name + "\""); - } - - try - { - _tid = dbEnv.txn_begin(null, 0); - } - catch(com.sleepycat.db.DbException e) - { - DBException ex = new DBException(); - ex.initCause(e); - ex.message = _errorPrefix + "DbEnv.txn_begin: " + e.getMessage(); - throw ex; - } - } - - private Ice.Communicator _communicator; - private int _trace = 0; - - private com.sleepycat.db.DbTxn _tid; - - private String _name; - private String _errorPrefix; -} |