{
jtsLogger.logger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ContextManager::popAction ()");
}
ControlWrapper action = null;
Object arg = otsCurrent.get(threadId);
if (arg != null)
{
Stack sl = (Stack) arg;
try
{
/*
* When we pushed the action we did the check for whether
* it was local to save time now.
*/
action = (ControlWrapper) sl.pop();
}
catch (EmptyStackException e)
{
}
/*
* If size now zero we can delete from thread
* specific data.
*/
if (sl.size() == 0)
{
sl = null;
otsCurrent.remove(threadId);
disassociateContext();
}
}
/*
* Now update action in thread's notion of current if
* this action is local.
*/
// Check that action is local and not a proxy.
if (action != null)
{
/*
* Now update action in thread's notion of current if
* this action is local.
*/
// Check that action is local and not a proxy.
if (action.isLocal())
{
/*
* If transaction is terminated by another thread
* then our thread-action information may have already
* been removed from the action.