Author: bstansberry(a)jboss.com
Date: 2007-09-17 23:25:16 -0400 (Mon, 17 Sep 2007)
New Revision: 4479
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
Log:
[JBCACHE-1175] Option to force call sync/async
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java 2007-09-18
03:23:34 UTC (rev 4478)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java 2007-09-18
03:25:16 UTC (rev 4479)
@@ -300,6 +300,7 @@
if (implicitTransaction)
{
copyInvocationScopeOptionsToTxScope(ctx);
+ copyForcedCacheModeToTxScope(ctx);
txManager.commit();
}
}
@@ -327,6 +328,26 @@
return result;
}
+ /**
+ * @param ctx
+ */
+ private void copyForcedCacheModeToTxScope(InvocationContext ctx)
+ {
+ Option optionOverride = ctx.getOptionOverrides();
+ if (optionOverride != null
+ && (optionOverride.isForceAsynchronous() ||
optionOverride.isForceSynchronous()))
+ {
+ TransactionEntry entry = txTable.get(ctx.getGlobalTransaction());
+ if (entry != null)
+ {
+ if (optionOverride.isForceAsynchronous())
+ entry.setForceAsyncReplication(true);
+ else
+ entry.setForceSyncReplication(true);
+ }
+ }
+ }
+
private MethodCall attachGlobalTransaction(InvocationContext ctx, Transaction tx,
MethodCall m) throws Exception
{
if (log.isDebugEnabled())
Show replies by date