try
{
while (it.hasNext())
{
SoftReference<XASessionImpl> sr = it.next();
XASessionImpl xaSession = sr.get();
if (xaSession != null && xaSession.isLive())
{
xaSession.getTransientNodesManager().getTransactManager().commit();
}
hasCommitedXASession = true;
}
}
catch (TransactionException e)
{
if (onePhase)
{
// rollback now
while (it.hasNext())
{
SoftReference<XASessionImpl> sr = it.next();
XASessionImpl xaSession = sr.get();
if (xaSession != null && xaSession.isLive())
{
xaSession.getTransientNodesManager().getTransactManager().rollback();
}
}
if (hasCommitedXASession)
{