Methods Summary |
---|
public void | begin()
try {
connection = transactionManager.connections.getConnection();
}
catch (SQLException sqle) {
sqle.printStackTrace();
throw new SystemException(sqle.toString());
}
status = Status.STATUS_ACTIVE;
|
public void | commit()
if (status == Status.STATUS_MARKED_ROLLBACK) {
rollback();
}
else {
status = Status.STATUS_PREPARING;
for ( int i=0; i<synchronizations.size(); i++ ) {
Synchronization s = (Synchronization) synchronizations.get(i);
s.beforeCompletion();
}
status = Status.STATUS_COMMITTING;
try {
connection.commit();
connection.close();
}
catch (SQLException sqle) {
status = Status.STATUS_UNKNOWN;
throw new SystemException();
}
status = Status.STATUS_COMMITTED;
for ( int i=0; i<synchronizations.size(); i++ ) {
Synchronization s = (Synchronization) synchronizations.get(i);
s.afterCompletion(status);
}
//status = Status.STATUS_NO_TRANSACTION;
transactionManager.endCurrent(this);
}
|
public boolean | delistResource(javax.transaction.xa.XAResource arg0, int arg1)
// TODO Auto-generated method stub
return false;
|
public boolean | enlistResource(javax.transaction.xa.XAResource arg0)
// TODO Auto-generated method stub
return false;
|
public java.sql.Connection | getConnection()
return connection;
|
public int | getStatus()
return status;
|
public void | registerSynchronization(javax.transaction.Synchronization sync)
synchronizations.add(sync);
|
public void | rollback()
status = Status.STATUS_ROLLING_BACK;
// Synch.beforeCompletion() should *not* be called for rollbacks
// for ( int i=0; i<synchronizations.size(); i++ ) {
// Synchronization s = (Synchronization) synchronizations.get(i);
// s.beforeCompletion();
// }
status = Status.STATUS_ROLLEDBACK;
try {
connection.rollback();
connection.close();
}
catch (SQLException sqle) {
status = Status.STATUS_UNKNOWN;
throw new SystemException();
}
for ( int i=0; i<synchronizations.size(); i++ ) {
Synchronization s = (Synchronization) synchronizations.get(i);
s.afterCompletion(status);
}
//status = Status.STATUS_NO_TRANSACTION;
transactionManager.endCurrent(this);
|
void | setConnection(java.sql.Connection connection)
this.connection = connection;
|
public void | setRollbackOnly()
status = Status.STATUS_MARKED_ROLLBACK;
|