}
PrepareCommand prepareCommand = commandCreator.createPrepareCommand(localTransaction.getGlobalTransaction(), localTransaction.getModifications());
if (trace) log.tracef("Sending prepare command through the chain: %s", prepareCommand);
LocalTxInvocationContext ctx = icc.createTxInvocationContext();
prepareCommand.setReplayEntryWrapping(replayEntryWrapping);
ctx.setLocalTransaction(localTransaction);
try {
invoker.invoke(ctx, prepareCommand);
if (localTransaction.isReadOnly()) {
if (trace) log.tracef("Readonly transaction: %s", localTransaction.getGlobalTransaction());
// force a cleanup to release any objects held. Some TMs don't call commit if it is a READ ONLY tx. See ISPN-845