tsLogger.arjLogger.debug(DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_ABSTRACT_REC, "PersistenceRecord::topLevelPrepare() for "
+ order());
}
int result = TwoPhaseOutcome.PREPARE_NOTOK;
StateManager sm = super.objectAddr;
if ((sm != null) && (store != null))
{
/*
* Get ready to create our state to be saved. At this stage we're not
* sure if the state will go into its own log or be written into the
* transaction log for improved performance.
*/
topLevelState = new OutputObjectState(sm.get_uid(), sm.type());
if (writeOptimisation
&& (!store.fullCommitNeeded()
&& (sm.save_state(topLevelState, ObjectType.ANDPERSISTENT)) && (topLevelState.size() <= PersistenceRecord.MAX_OBJECT_SIZE)))
{
/*
* We assume that crash recovery will always run before
* the object can be reactivated!
*/
if (PersistenceRecord.classicPrepare)
{
OutputObjectState dummy = new OutputObjectState(
Uid.nullUid(), null);
/*
* Write an empty shadow state to the store to indicate one
* exists, and to prevent bogus activation in the case where
* crash recovery hasn't run yet.
*/
try
{
store.write_uncommitted(sm.get_uid(), sm.type(), dummy);
result = TwoPhaseOutcome.PREPARE_OK;
}
catch (ObjectStoreException e)
{
tsLogger.arjLoggerI18N.warn("com.arjuna.ats.arjuna.PersistenceRecord_21", e);
}
dummy = null;
}
else
{
/*
* Don't write anything as our state will go into the log.
*/
result = TwoPhaseOutcome.PREPARE_OK;
}
}
else
{
if (sm.deactivate(store.getStoreName(), false))
{
shadowMade = true;
result = TwoPhaseOutcome.PREPARE_OK;
}