item.markAsDead();
// use Inactive as an indication that the parent process
// has gone
throw new Inactive();
}
else
{
return otsStatus;
}
}
else
{
// factory in item is null - process already dead
if (jtsLogger.loggerI18N.isDebugEnabled())
{
jtsLogger.loggerI18N.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
FacilityCode.FAC_CRASH_RECOVERY,
"com.arjuna.ats.internal.jts.recovery.contact.StatusChecker_13",
new Object[]{transactionUid});
}
/*
* In which case we can use the current, in process local factory, to
* look at the object store and get the status from that. At present
* all factories can look at the entire object store on a machine, so
* this will work. If a factory is limited to only a portion of the object
* store then we may need to create an explicit factory that has "global"
* knowledge.
*/
if ( checkTheObjectStore )
{
try
{
Status s = OTSManager.factory().getStatus(transactionUid);
/*
* If the status is committing or rolling back from a dead
* (local) process then we can direct recovery now.
*/
if (s == Status.StatusCommitting)
return Status.StatusCommitted;
else
{
if (s == Status.StatusRollingBack)
return Status.StatusRolledBack;
}
return s;
}
catch (NoTransaction e1)
{
return Status.StatusNoTransaction;
}
catch (SystemException e2)
{
return Status.StatusUnknown;
}
}
else
{
throw new Inactive();
}
}
}