Menu

#195 possible solution for bug 481358&486416

v2.4 (stable)
open
nobody
None
5
2002-04-10
2002-04-10
No

JDK 1.3.1. JBoss 2.4.4 on Win NT

These bugs concern the user transaction commit phase
when invoked from the client side. It seems that
during the invocation of UserTransactionSessionImpl.
commit(), the transaction / calling thread relation is
not resumed. This prevents any db changes made by a tx
listener to be committed in the db.

If the UserTransactionSessionImpl.commit( Object tpc)
method resumes this relation, changes are committed in
the db. This is also valable for the rollback method.

I did not notice any side effect due to this patch,
homewer I don't have a clear idea of the transaction
management in JBoss. could you review this solution ?

Emmanuel

Proposed change :
file : UserTransactionSessionImpl.java

public void commit(Object tpc)
throws RemoteException,
RollbackException,
HeuristicMixedException,
HeuristicRollbackException,
SecurityException,
IllegalStateException,
SystemException
{
Transaction tx = (Transaction)activeTx.get(tpc);

if (tx == null)
throw new IllegalStateException("No
transaction.");

//*** added patch
TransactionManager tm = getTransactionManager();

Transaction currentTx = tm.suspend();
tm.resume(tx);
//*** end of change

boolean finished = true;

try {
System.out.println("commit user
transaction");
System.out.println("Current transaction
is "+ tx + " / " + tx.getClass());
System.out.println("Current thread
transaction is "+ tm.getTransaction());

tx.commit();
System.out.println("end of commit user
transaction");

} catch (java.lang.SecurityException ex) {
finished = false;
throw ex;
} catch (java.lang.IllegalStateException ex) {
finished = false;
throw ex;
} finally {
activeTx.remove(tpc);

//*** added patch
tm.suspend();

if ( currentTx != null)
tm.resume(currentTx);
//*** end of change

}
}

Discussion


Log in to post a comment.

MongoDB Logo MongoDB