}
return invokeNextInterceptor(ctx, command);
}
private Object enlistWriteAndInvokeNext(InvocationContext ctx, WriteCommand command) throws Throwable {
TransactionXaAdapter xaAdapter = null;
boolean shouldAddMod = false;
if (shouldEnlist(ctx)) {
xaAdapter = enlist(ctx);
LocalTxInvocationContext localTxContext = (LocalTxInvocationContext) ctx;
if (!isLocalModeForced(ctx)) {
shouldAddMod = true;
}
localTxContext.setXaCache(xaAdapter);
}
Object rv = invokeNextInterceptor(ctx, command);
if (!ctx.isInTxScope())
transactionLog.logNoTxWrite(command);
if (command.isSuccessful() && shouldAddMod) xaAdapter.addModification(command);
return rv;
}