public void tidyup() throws ResourceException
{
// We have a hanging transaction
if (localTransaction.get())
{
LocalTransaction local = null;
ManagedConnection mc = getManagedConnection();
try
{
local = mc.getLocalTransaction();
}
catch (Throwable t)
{
JBossResourceException.rethrowAsResourceException("Unfinished local transaction - " +
"error getting local transaction from " + this, t);
}
if (local == null)
throw new ResourceException("Unfinished local transaction but managed connection does not " +
"provide a local transaction. " + this);
else
{
local.rollback();
getLog().debug("Unfinished local transaction was rolled back." + this);
}
}
}