Author: manik.surtani(a)jboss.com
Date: 2008-05-09 14:14:06 -0400 (Fri, 09 May 2008)
New Revision: 5825
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/BaseTransactionalContextInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/InvocationContextInterceptor.java
Log:
JBCACHE-1328 - profile and optimise TxTable lookups
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/BaseTransactionalContextInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/BaseTransactionalContextInterceptor.java 2008-05-09
17:57:36 UTC (rev 5824)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/BaseTransactionalContextInterceptor.java 2008-05-09
18:14:06 UTC (rev 5825)
@@ -52,7 +52,7 @@
}
ctx.setTransaction(tx);
ctx.setGlobalTransaction(gtx);
- ctx.setTransactionEntry(txTable.get(gtx));
+ if (gtx != null) ctx.setTransactionEntry(txTable.get(gtx));
}
/**
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/InvocationContextInterceptor.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/interceptors/InvocationContextInterceptor.java 2008-05-09
17:57:36 UTC (rev 5824)
+++
core/trunk/src/main/java/org/jboss/cache/interceptors/InvocationContextInterceptor.java 2008-05-09
18:14:06 UTC (rev 5825)
@@ -113,10 +113,17 @@
try
{
- Transaction tx = getTransaction();
- GlobalTransaction realGtx = getGlobalTransaction(tx, gtx);
- if (tx == null && realGtx != null && realGtx.isRemote()) tx =
txTable.getLocalTransaction(gtx);
- setTransactionalContext(tx, realGtx, ctx);
+ if (txManager != null)
+ {
+ Transaction tx = getTransaction();
+ GlobalTransaction realGtx = getGlobalTransaction(tx, gtx);
+ if (tx == null && realGtx != null && realGtx.isRemote()) tx =
txTable.getLocalTransaction(gtx);
+ setTransactionalContext(tx, realGtx, ctx);
+ }
+ else
+ {
+ setTransactionalContext(null, null, ctx);
+ }
if (optionOverride != null)
{