com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ServerTopLevelAction::commit for "+_theUid);
}
if (_theControl == null)
{
throw new INVALID_TRANSACTION(ExceptionCodes.SERVERAA_NO_CONTROL, CompletionStatus.COMPLETED_NO);
}
if (_theControl.isWrapper())
{
destroyResource();
return;
}
ServerTransaction theTransaction = (ServerTransaction) _theControl.getImplHandle();
// ThreadActionData.pushAction(theTransaction);
int actionStatus = theTransaction.status();
boolean notPrepared = false;
if (actionStatus == ActionStatus.PREPARED)
{
/*
* This will also call any after_completions on
* registered synchronizations.
*/
actionStatus = theTransaction.doPhase2Commit();
}
else
{
if (actionStatus == ActionStatus.RUNNING)
{
if (jtsLogger.logger.isDebugEnabled())
{
jtsLogger.logger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ServerTopLevelAction::commit for "+_theUid+" : NotPrepared");
}
notPrepared = true;
}
}
ThreadActionData.popAction();
if (notPrepared)
throw new NotPrepared();
if (jtsLogger.logger.isDebugEnabled())
{
jtsLogger.logger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
com.arjuna.ats.jts.logging.FacilityCode.FAC_OTS, "ServerTopLevelAction::commit for "+_theUid+" : "+ActionStatus.stringForm(actionStatus));
}
switch (actionStatus)
{
case ActionStatus.PREPARED:
throw new INVALID_TRANSACTION(ExceptionCodes.SERVERAA_NO_CONTROL, CompletionStatus.COMPLETED_NO);
case ActionStatus.COMMITTED:
case ActionStatus.H_COMMIT:
destroyResource();
break;
case ActionStatus.ABORTED: