Details
-
Bug
-
Resolution: Done
-
Major
-
JBossAS-4.0.5.CR1
-
None
Description
There is a missing branch in the StdServerSession commit logic.
In the case where the transaction manager rollsback the transaction early,
e.g. JBossTM does this for transaction timeouts, the status will be NO_TRANSACTION
(or a heuristic state).
The code:
// Marked rollback
if (trans.getStatus() == Status.STATUS_MARKED_ROLLBACK)
{
if (trace)
log.trace(StdServerSession.this + " rolling back JMS transaction tx=" + trans);
// actually roll it back
tm.rollback();
// NO XASession? then manually rollback.
// This is not so good but
// it's the best we can do if we have no XASession.
if (xaSession == null && serverSessionPool.isTransacted())
}
else if (trans.getStatus() == Status.STATUS_ACTIVE)
{
// Commit tx
// This will happen if
// a) everything goes well
// b) app. exception was thrown
if (trace)
log.trace(StdServerSession.this + " commiting the JMS transaction tx=" + trans);
tm.commit();
// NO XASession? then manually commit. This is not so good but
// it's the best we can do if we have no XASession.
if (xaSession == null && serverSessionPool.isTransacted())
{ session.commit(); }
}
needs an extra branch:
else
{
if (trace)
log.trace(StdServerSession.this + " transaction already ended tx=" + trans);
// spend the thread association
tm.suspend();
// NO XASession? then manually rollback.
// This is not so good but
// it's the best we can do if we have no XASession.
if (xaSession == null && serverSessionPool.isTransacted())
{ session.rollback(); }
}