JBoss Cache SVN: r5860 - core/trunk/src/test/java/org/jboss/cache/api/nodevalidity.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-05-15 18:54:22 -0400 (Thu, 15 May 2008)
New Revision: 5860
Modified:
core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/NodeValidityTestBase.java
Log:
Fixed broken test
Modified: core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/NodeValidityTestBase.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/NodeValidityTestBase.java 2008-05-15 22:53:17 UTC (rev 5859)
+++ core/trunk/src/test/java/org/jboss/cache/api/nodevalidity/NodeValidityTestBase.java 2008-05-15 22:54:22 UTC (rev 5860)
@@ -160,7 +160,7 @@
public void testEvict()
{
- // eviction should NOT affect validity
+ // eviction should affect validity
observer.put(parent, K, V);
Node<String, String> obsNode = observer.getRoot().getChild(parent);
@@ -170,7 +170,7 @@
// eviction needs to happen on the same cache being watched
observer.evict(parent, false);
- assert obsNode.isValid() : "Node should be valid";
+ assert !obsNode.isValid() : "Node should not be valid";
}
public void testOperationsOnInvalidNode()
15 years, 12 months
JBoss Cache SVN: r5859 - core/trunk/src/main/java/org/jboss/cache/loader.
by jbosscache-commits@lists.jboss.org
Author: galder.zamarreno(a)jboss.com
Date: 2008-05-15 18:53:17 -0400 (Thu, 15 May 2008)
New Revision: 5859
Modified:
core/trunk/src/main/java/org/jboss/cache/loader/AdjListJDBCCacheLoaderConfig.java
core/trunk/src/main/java/org/jboss/cache/loader/JDBCCacheLoader.java
core/trunk/src/main/java/org/jboss/cache/loader/JDBCCacheLoaderConfig.java
Log:
[JBCACHE-1342] Missing getters and setters added to enable individual property configuration. Variables containing sql sentences are checked for null in which case they're reconstructed enabling both setProperties() method construction and MC style, individual property construction.
Modified: core/trunk/src/main/java/org/jboss/cache/loader/AdjListJDBCCacheLoaderConfig.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/AdjListJDBCCacheLoaderConfig.java 2008-05-15 22:32:10 UTC (rev 5858)
+++ core/trunk/src/main/java/org/jboss/cache/loader/AdjListJDBCCacheLoaderConfig.java 2008-05-15 22:53:17 UTC (rev 5859)
@@ -37,6 +37,10 @@
private String updateNodeSql;
private String updateTableSql;
private String connectionFactoryClass;
+ private String primaryKey;
+ private String fqnType;
+ private String nodeType;
+ private String parentColumn;
protected String table;
protected String nodeColumn;
protected String fqnColumn;
@@ -68,6 +72,10 @@
public String getCreateTableDDL()
{
+ if (createTableDDL == null)
+ {
+ setCreateTableDDL(constructCreateTableDDL());
+ }
return createTableDDL;
}
@@ -90,6 +98,10 @@
public String getDeleteAllSql()
{
+ if (deleteAllSql == null)
+ {
+ setDeleteAllSql(constructDeleteAllSql());
+ }
return deleteAllSql;
}
@@ -101,6 +113,10 @@
public String getDeleteNodeSql()
{
+ if (deleteNodeSql == null)
+ {
+ setDeleteNodeSql(constructDeleteNodeSql());
+ }
return deleteNodeSql;
}
@@ -134,6 +150,10 @@
public String getInsertNodeSql()
{
+ if (insertNodeSql == null)
+ {
+ setInsertNodeSql(constructInsertNodeSql());
+ }
return insertNodeSql;
}
@@ -145,6 +165,10 @@
public String getSelectChildFqnsSql()
{
+ if (selectChildFqnsSql == null)
+ {
+ setSelectChildFqnsSql(constructSelectChildNamesSql());
+ }
return selectChildFqnsSql;
}
@@ -156,6 +180,10 @@
public String getSelectNodeSql()
{
+ if (selectNodeSql == null)
+ {
+ setSelectNodeSql(constructSelectNodeSql());
+ }
return selectNodeSql;
}
@@ -189,6 +217,10 @@
public String getDropTableDDL()
{
+ if (dropTableDDL == null)
+ {
+ setDropTableDDL(constructDropTableDDL());
+ }
return dropTableDDL;
}
@@ -200,6 +232,10 @@
public String getSelectChildNamesSql()
{
+ if (selectChildNamesSql == null)
+ {
+ setSelectChildNamesSql(constructSelectChildNamesSql());
+ }
return selectChildNamesSql;
}
@@ -211,6 +247,10 @@
public String getUpdateNodeSql()
{
+ if (updateNodeSql == null)
+ {
+ setUpdateNodeSql(constructUpdateNodeSql());
+ }
return updateNodeSql;
}
@@ -263,7 +303,73 @@
testImmutability("connectionFactoryClass");
this.connectionFactoryClass = connectionFactoryClass;
}
+
+ public String getPrimaryKey()
+ {
+ return primaryKey;
+ }
+ public void setPrimaryKey(String primaryKey)
+ {
+ testImmutability("primaryKey");
+ this.primaryKey = primaryKey;
+ }
+
+ public String getFqnType()
+ {
+ return fqnType;
+ }
+
+ public void setFqnType(String fqnType)
+ {
+ testImmutability("fqnType");
+ this.fqnType = fqnType;
+ }
+
+ public String getNodeType()
+ {
+ return nodeType;
+ }
+
+ public void setNodeType(String nodeType)
+ {
+ testImmutability("nodeType");
+ this.nodeType = nodeType;
+ }
+
+ public String getParentColumn()
+ {
+ return parentColumn;
+ }
+
+ public void setParentColumn(String parentColumn)
+ {
+ testImmutability("parentColumn");
+ this.parentColumn = parentColumn;
+ }
+
+ public String getNodeColumn()
+ {
+ return nodeColumn;
+ }
+
+ public void setNodeColumn(String nodeColumn)
+ {
+ testImmutability("nodeColumn");
+ this.nodeColumn = nodeColumn;
+ }
+
+ public String getFqnColumn()
+ {
+ return fqnColumn;
+ }
+
+ public void setFqnColumn(String fqnColumn)
+ {
+ testImmutability("fqnColumn");
+ this.fqnColumn = fqnColumn;
+ }
+
@Override
public void setProperties(Properties props)
{
@@ -297,30 +403,36 @@
this.dropTable = prop == null ? false : Boolean.valueOf(prop);
this.table = props.getProperty("cache.jdbc.table.name", "jbosscache");
- String primaryKey = props.getProperty("cache.jdbc.table.primarykey", "jbosscache_pk");
+ primaryKey = props.getProperty("cache.jdbc.table.primarykey", "jbosscache_pk");
fqnColumn = props.getProperty("cache.jdbc.fqn.column", "fqn");
- String fqnType = props.getProperty("cache.jdbc.fqn.type", "varchar(255)");
+ fqnType = props.getProperty("cache.jdbc.fqn.type", "varchar(255)");
nodeColumn = props.getProperty("cache.jdbc.node.column", "node");
- String nodeType = props.getProperty("cache.jdbc.node.type", "blob");
- String parentColumn = props.getProperty("cache.jdbc.parent.column", "parent");
+ nodeType = props.getProperty("cache.jdbc.node.type", "blob");
+ parentColumn = props.getProperty("cache.jdbc.parent.column", "parent");
- selectChildNamesSql = "select " + fqnColumn + " from " + table + " where " + parentColumn + "=?";
- deleteNodeSql = "delete from " + table + " where " + fqnColumn + "=?";
- deleteAllSql = "delete from " + table;
- selectChildFqnsSql = "select " + fqnColumn + " from " + table + " where " + parentColumn + "=?";
- insertNodeSql = "insert into " +
- table +
- " (" +
- fqnColumn +
- ", " +
- nodeColumn +
- ", " +
- parentColumn +
- ") values (?, ?, ?)";
- updateNodeSql = "update " + table + " set " + nodeColumn + "=? where " + fqnColumn + "=?";
- selectNodeSql = "select " + nodeColumn + " from " + table + " where " + fqnColumn + "=?";
+ selectChildNamesSql = constructSelectChildNamesSql();
+ deleteNodeSql = constructDeleteNodeSql();
+ deleteAllSql = constructDeleteAllSql();
+ /* select child fqns and select child names sql is the same */
+ selectChildFqnsSql = constructSelectChildNamesSql();
+ insertNodeSql = constructInsertNodeSql();
+ updateNodeSql = constructUpdateNodeSql();
+ selectNodeSql = constructSelectNodeSql();
- createTableDDL = "create table " +
+ createTableDDL = constructCreateTableDDL();
+
+ dropTableDDL = constructDropTableDDL();
+ connectionFactoryClass = props.getProperty("cache.jdbc.connection.factory", "org.jboss.cache.loader.NonManagedConnectionFactory");
+ }
+
+ private String constructDropTableDDL()
+ {
+ return "drop table " + table;
+ }
+
+ private String constructCreateTableDDL()
+ {
+ return "create table " +
table +
"(" +
fqnColumn +
@@ -335,9 +447,6 @@
" " +
fqnType +
", constraint " + primaryKey + " primary key (" + fqnColumn + "))";
-
- dropTableDDL = "drop table " + table;
- connectionFactoryClass = props.getProperty("cache.jdbc.connection.factory", "org.jboss.cache.loader.NonManagedConnectionFactory");
}
@Override
@@ -365,7 +474,11 @@
&& Util.safeEquals(table, other.table)
&& Util.safeEquals(updateNodeSql, other.updateNodeSql)
&& Util.safeEquals(updateTableSql, other.updateTableSql)
- && Util.safeEquals(connectionFactoryClass, other.connectionFactoryClass);
+ && Util.safeEquals(connectionFactoryClass, other.connectionFactoryClass)
+ && Util.safeEquals(primaryKey, other.primaryKey)
+ && Util.safeEquals(nodeType, other.nodeType)
+ && Util.safeEquals(fqnType, other.fqnType)
+ && Util.safeEquals(parentColumn, other.parentColumn);
}
return false;
@@ -394,6 +507,10 @@
result = 31 * result + (updateNodeSql == null ? 0 : updateNodeSql.hashCode());
result = 31 * result + (updateTableSql == null ? 0 : updateTableSql.hashCode());
result = 31 * result + (connectionFactoryClass == null ? 0 : connectionFactoryClass.hashCode());
+ result = 31 * result + (primaryKey == null ? 0 : primaryKey.hashCode());
+ result = 31 * result + (nodeType == null ? 0 : nodeType.hashCode());
+ result = 31 * result + (fqnType == null ? 0 : fqnType.hashCode());
+ result = 31 * result + (parentColumn == null ? 0 : parentColumn.hashCode());
return result;
}
@@ -404,4 +521,41 @@
return (AdjListJDBCCacheLoaderConfig) super.clone();
}
+ private String constructSelectNodeSql()
+ {
+ return "select " + nodeColumn + " from " + table + " where " + fqnColumn + "=?";
+ }
+
+ private String constructUpdateNodeSql()
+ {
+ return "update " + table + " set " + nodeColumn + "=? where " + fqnColumn + "=?";
+ }
+
+ private String constructDeleteAllSql()
+ {
+ return "delete from " + table;
+ }
+
+ private String constructDeleteNodeSql()
+ {
+ return "delete from " + table + " where " + fqnColumn + "=?";
+ }
+
+ private String constructSelectChildNamesSql()
+ {
+ return "select " + fqnColumn + " from " + table + " where " + parentColumn + "=?";
+ }
+
+ private String constructInsertNodeSql()
+ {
+ return "insert into " +
+ table +
+ " (" +
+ fqnColumn +
+ ", " +
+ nodeColumn +
+ ", " +
+ parentColumn +
+ ") values (?, ?, ?)";
+ }
}
\ No newline at end of file
Modified: core/trunk/src/main/java/org/jboss/cache/loader/JDBCCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/JDBCCacheLoader.java 2008-05-15 22:32:10 UTC (rev 5858)
+++ core/trunk/src/main/java/org/jboss/cache/loader/JDBCCacheLoader.java 2008-05-15 22:53:17 UTC (rev 5859)
@@ -267,6 +267,11 @@
ResultSet rs = null;
try
{
+ if (getLogger().isDebugEnabled())
+ {
+ getLogger().debug("executing sql: " + config.getNodeCountSql());
+ }
+
conn = cf.getConnection();
ps = conn.prepareStatement(config.getNodeCountSql());
rs = ps.executeQuery();
Modified: core/trunk/src/main/java/org/jboss/cache/loader/JDBCCacheLoaderConfig.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/JDBCCacheLoaderConfig.java 2008-05-15 22:32:10 UTC (rev 5858)
+++ core/trunk/src/main/java/org/jboss/cache/loader/JDBCCacheLoaderConfig.java 2008-05-15 22:53:17 UTC (rev 5859)
@@ -10,6 +10,7 @@
* Builds the different SQLs needed by <tt>JDBCCacheLoader</tt>.
*
* @author Mircea.Markus(a)iquestint.com
+ * @author <a href="mailto:galder.zamarreno@jboss.com">Galder Zamarreno</a>
* @version 1.0
*/
public class JDBCCacheLoaderConfig extends AdjListJDBCCacheLoaderConfig
@@ -19,10 +20,13 @@
private static final Log log = LogFactory.getLog(JDBCCacheLoaderConfig.class);
- private String deleteNode;
- private String recursiveChildren;
+ private String deleteNodeSql;
+ private String recursiveChildrenSql;
private String nodeCountSql;
+ private String sqlConcat;
+ private String startingWith;
+ private String appendSepparator;
public JDBCCacheLoaderConfig(IndividualCacheLoaderConfig base)
{
@@ -39,27 +43,28 @@
public void setProperties(Properties props)
{
super.setProperties(props);
- String sqlConcat = props.getProperty("cache.jdbc.sql-concat");
- if (sqlConcat == null)
- {
- log.info("Missiing JDBCCacheLoader config 'cache.jdbc.sql-concat', using default value:'concat(1,2)'");
- sqlConcat = "concat(1,2)";
- }
- String startingWith = sqlConcat.replace('1', '?').replace("2", "'%'"); //concat(?, '%')
- String appendSepparator = sqlConcat.replace("1", fqnColumn).replace("2", "'/'"); //concat(fqnColumn, '/')
- deleteNode = "delete from " + table + " where " + appendSepparator + " like " + startingWith;
- recursiveChildren = "select " + fqnColumn + "," + nodeColumn + " from " + table + " where " + appendSepparator + " like " + startingWith;
- nodeCountSql = "select count(*) from " + table;
+ sqlConcat = props.getProperty("cache.jdbc.sql-concat");
+
+ disectSqlConcat();
+
+ deleteNodeSql = constructDeleteNodeSql();
+ recursiveChildrenSql = constructRecursiveChildrenSql();
+ nodeCountSql = constructNodeCountSql();
}
-
/**
* Returns the sql string for removing a node and all its children.
*/
@Override
public String getDeleteNodeSql()
{
- return deleteNode;
+ if (startingWith == null || appendSepparator == null || deleteNodeSql == null)
+ {
+ disectSqlConcat();
+ setDeleteNodeSql(constructDeleteNodeSql());
+ }
+
+ return deleteNodeSql;
}
/**
@@ -67,15 +72,93 @@
*/
public String getRecursiveChildrenSql()
{
- return recursiveChildren;
+ if (startingWith == null || appendSepparator == null || recursiveChildrenSql == null)
+ {
+ disectSqlConcat();
+ setRecursiveChildrenSql(constructRecursiveChildrenSql());
+ }
+
+ return recursiveChildrenSql;
}
+ public void setRecursiveChildrenSql(String recursiveChildrenSql)
+ {
+ this.recursiveChildrenSql = recursiveChildrenSql;
+ }
/**
* Returns an sql that will count all the persisted node.
*/
public String getNodeCountSql()
{
+ if (startingWith == null || appendSepparator == null || nodeCountSql == null)
+ {
+ disectSqlConcat();
+ setNodeCountSql(constructNodeCountSql());
+ }
+
return nodeCountSql;
}
-}
+
+ public void setNodeCountSql(String nodeCountSql)
+ {
+ this.nodeCountSql = nodeCountSql;
+ }
+
+ public String getSqlConcat()
+ {
+ return sqlConcat;
+ }
+
+ public void setSqlConcat(String sqlConcat)
+ {
+ testImmutability("sqlConcat");
+ this.sqlConcat = sqlConcat;
+ }
+
+ public String getStartingWith()
+ {
+ return startingWith;
+ }
+
+ public void setStartingWith(String startingWith)
+ {
+ this.startingWith = startingWith;
+ }
+
+ public String getAppendSepparator()
+ {
+ return appendSepparator;
+ }
+
+ public void setAppendSepparator(String appendSepparator)
+ {
+ this.appendSepparator = appendSepparator;
+ }
+
+ private void disectSqlConcat()
+ {
+ if (sqlConcat == null)
+ {
+ log.info("Missiing JDBCCacheLoader config 'cache.jdbc.sql-concat', using default value:'concat(1,2)'");
+ sqlConcat = "concat(1,2)";
+ }
+ startingWith = sqlConcat.replace('1', '?').replace("2", "'%'"); //concat(?, '%')
+ appendSepparator = sqlConcat.replace("1", fqnColumn).replace("2", "'/'"); //concat(fqnColumn, '/')
+ }
+
+ private String constructNodeCountSql()
+ {
+ return "select count(*) from " + table;
+ }
+
+ private String constructRecursiveChildrenSql()
+ {
+ return "select " + fqnColumn + "," + nodeColumn + " from " + table + " where " + appendSepparator + " like " + startingWith;
+ }
+
+ private String constructDeleteNodeSql()
+ {
+ return "delete from " + table + " where " + appendSepparator + " like " + startingWith;
+ }
+}
\ No newline at end of file
15 years, 12 months
JBoss Cache SVN: r5858 - core/trunk/src/test/java/org/jboss/cache/factories.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-05-15 18:32:10 -0400 (Thu, 15 May 2008)
New Revision: 5858
Modified:
core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainFactoryTest.java
Log:
Fixed broken test
Modified: core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainFactoryTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainFactoryTest.java 2008-05-15 22:30:34 UTC (rev 5857)
+++ core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainFactoryTest.java 2008-05-15 22:32:10 UTC (rev 5858)
@@ -203,7 +203,7 @@
assertEquals(8, list.size());
assertEquals(InvocationContextInterceptor.class, interceptors.next().getClass());
- assertEquals(TxInterceptor.class, interceptors.next().getClass());
+ assertEquals(OptimisticTxInterceptor.class, interceptors.next().getClass());
assertEquals(NotificationInterceptor.class, interceptors.next().getClass());
assertEquals(OptimisticLockingInterceptor.class, interceptors.next().getClass());
assertEquals(OptimisticValidatorInterceptor.class, interceptors.next().getClass());
@@ -227,7 +227,7 @@
assertEquals(9, list.size());
assertEquals(InvocationContextInterceptor.class, interceptors.next().getClass());
- assertEquals(TxInterceptor.class, interceptors.next().getClass());
+ assertEquals(OptimisticTxInterceptor.class, interceptors.next().getClass());
assertEquals(NotificationInterceptor.class, interceptors.next().getClass());
assertEquals(OptimisticReplicationInterceptor.class, interceptors.next().getClass());
assertEquals(OptimisticLockingInterceptor.class, interceptors.next().getClass());
@@ -252,7 +252,7 @@
assertEquals(10, list.size());
assertEquals(InvocationContextInterceptor.class, interceptors.next().getClass());
- assertEquals(TxInterceptor.class, interceptors.next().getClass());
+ assertEquals(OptimisticTxInterceptor.class, interceptors.next().getClass());
assertEquals(NotificationInterceptor.class, interceptors.next().getClass());
assertEquals(CacheLoaderInterceptor.class, interceptors.next().getClass());
assertEquals(CacheStoreInterceptor.class, interceptors.next().getClass());
@@ -278,7 +278,7 @@
assertEquals(10, list.size());
assertEquals(InvocationContextInterceptor.class, interceptors.next().getClass());
- assertEquals(TxInterceptor.class, interceptors.next().getClass());
+ assertEquals(OptimisticTxInterceptor.class, interceptors.next().getClass());
assertEquals(NotificationInterceptor.class, interceptors.next().getClass());
assertEquals(ActivationInterceptor.class, interceptors.next().getClass());
assertEquals(PassivationInterceptor.class, interceptors.next().getClass());
@@ -409,7 +409,7 @@
assertEquals(InvocationContextInterceptor.class, interceptors.next().getClass());
assertEquals(CacheMgmtInterceptor.class, interceptors.next().getClass());
- assertEquals(TxInterceptor.class, interceptors.next().getClass());
+ assertEquals(OptimisticTxInterceptor.class, interceptors.next().getClass());
assertEquals(NotificationInterceptor.class, interceptors.next().getClass());
assertEquals(OptimisticReplicationInterceptor.class, interceptors.next().getClass());
assertEquals(DataGravitatorInterceptor.class, interceptors.next().getClass());
15 years, 12 months
JBoss Cache SVN: r5857 - in core/trunk/src/main/java/org/jboss/cache: interceptors and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-05-15 18:30:34 -0400 (Thu, 15 May 2008)
New Revision: 5857
Modified:
core/trunk/src/main/java/org/jboss/cache/config/Configuration.java
core/trunk/src/main/java/org/jboss/cache/interceptors/NotificationInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticTxInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
Log:
fixed broken stuff
Modified: core/trunk/src/main/java/org/jboss/cache/config/Configuration.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/Configuration.java 2008-05-15 17:25:53 UTC (rev 5856)
+++ core/trunk/src/main/java/org/jboss/cache/config/Configuration.java 2008-05-15 22:30:34 UTC (rev 5857)
@@ -98,7 +98,7 @@
public boolean isSynchronous()
{
- return this == REPL_SYNC || this == INVALIDATION_SYNC;
+ return this == REPL_SYNC || this == INVALIDATION_SYNC || this == LOCAL;
}
}
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/NotificationInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/NotificationInterceptor.java 2008-05-15 17:25:53 UTC (rev 5856)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/NotificationInterceptor.java 2008-05-15 22:30:34 UTC (rev 5857)
@@ -1,8 +1,8 @@
package org.jboss.cache.interceptors;
-import org.jboss.cache.CacheSPI;
import org.jboss.cache.InvocationContext;
import org.jboss.cache.commands.tx.CommitCommand;
+import org.jboss.cache.commands.tx.PrepareCommand;
import org.jboss.cache.commands.tx.RollbackCommand;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.notifications.NotifierImpl;
@@ -16,16 +16,23 @@
public class NotificationInterceptor extends BaseTransactionalContextInterceptor
{
private NotifierImpl notifier;
- private CacheSPI cacheSPI;
@Inject
- public void injectDependencies(NotifierImpl notifier, CacheSPI cacheSPI)
+ public void injectDependencies(NotifierImpl notifier)
{
this.notifier = notifier;
- this.cacheSPI = cacheSPI;
}
@Override
+ public Object visitPrepareCommand(InvocationContext ctx, PrepareCommand command) throws Throwable
+ {
+ Object retval = invokeNextInterceptor(ctx, command);
+ if (command.isOnePhaseCommit()) notifier.notifyTransactionCompleted(ctx.getTransaction(), true, ctx);
+
+ return retval;
+ }
+
+ @Override
public Object visitCommitCommand(InvocationContext ctx, CommitCommand command) throws Throwable
{
Object retval = invokeNextInterceptor(ctx, command);
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticTxInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticTxInterceptor.java 2008-05-15 17:25:53 UTC (rev 5856)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticTxInterceptor.java 2008-05-15 22:30:34 UTC (rev 5857)
@@ -123,7 +123,7 @@
* @throws Throwable
*/
@Override
- protected boolean replayModifications(InvocationContext ctx, Transaction ltx, PrepareCommand command) throws Throwable
+ protected void replayModifications(InvocationContext ctx, Transaction ltx, PrepareCommand command) throws Throwable
{
if (log.isDebugEnabled()) log.debug("Handling optimistic remote prepare " + ctx.getGlobalTransaction());
@@ -135,9 +135,8 @@
catch (Throwable t)
{
log.error("Prepare failed!", t);
- return false;
+ throw t;
}
- return true;
}
@Override
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java 2008-05-15 17:25:53 UTC (rev 5856)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java 2008-05-15 22:30:34 UTC (rev 5857)
@@ -373,9 +373,13 @@
// register a sync handler for this tx.
registerHandler(ltx, new RemoteSynchronizationHandler(gtx, ltx, entry), ctx);
+ success = false;
+
// replay modifications
- success = replayModifications(ctx, ltx, command);
+ replayModifications(ctx, ltx, command);
+ success = true; // no exceptions were thrown above!!
+
// now pass the prepare command up the chain as well.
if (command.isOnePhaseCommit())
{
@@ -485,7 +489,7 @@
* @return
* @throws Exception
*/
- protected boolean replayModifications(InvocationContext ctx, Transaction ltx, PrepareCommand command) throws Throwable
+ protected void replayModifications(InvocationContext ctx, Transaction ltx, PrepareCommand command) throws Throwable
{
try
{
@@ -495,12 +499,11 @@
invokeNextInterceptor(ctx, modification);
assertTxIsStillValid(ltx);
}
- return true;
}
catch (Throwable th)
{
log.error("prepare failed!", th);
- return false;
+ throw th;
}
}
15 years, 12 months
JBoss Cache SVN: r5856 - core/trunk/src/main/java/org/jboss/cache/interceptors.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-05-15 13:25:53 -0400 (Thu, 15 May 2008)
New Revision: 5856
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor.java
Log:
fixed broken stuff
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor.java 2008-05-15 16:07:47 UTC (rev 5855)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor.java 2008-05-15 17:25:53 UTC (rev 5856)
@@ -86,7 +86,12 @@
@Override
public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable
{
- if (command.isPutForExternalRead()) return invokeNextInterceptor(ctx, command);
+ if (command.isPutForExternalRead())
+ {
+ // these are always local more, as far as invalidation is concerned
+ if (ctx.getTransaction() != null) ctx.getTransactionEntry().addLocalModification(command);
+ return invokeNextInterceptor(ctx, command);
+ }
return handleWriteMethod(ctx, command.getFqn(), null, command);
}
@@ -129,13 +134,17 @@
if (entry.hasModifications())
{
+ List<ReversibleCommand> mods;
if (entry.hasLocalModifications())
{
- PrepareCommand clone = command.clone();
- clone.removeModifications(entry.getLocalModifications());
- command = clone;
+ mods = new ArrayList<ReversibleCommand>(command.getModifications());
+ mods.removeAll(entry.getLocalModifications());
}
- broadcastInvalidate(command.getModifications(), tx, ctx);
+ else
+ {
+ mods = command.getModifications();
+ }
+ broadcastInvalidate(mods, tx, ctx);
}
else
{
@@ -356,7 +365,7 @@
protected void invalidateAcrossCluster(Fqn fqn, TransactionWorkspace workspace, boolean synchronous, InvocationContext ctx) throws Throwable
{
- if (ctx.getTransaction() != null && !isLocalModeForced(ctx))
+ if (!isLocalModeForced(ctx))
{
// increment invalidations counter if statistics maintained
incrementInvalidations();
15 years, 12 months
JBoss Cache SVN: r5855 - in core/branches/2.1.X/src: test/java/org/jboss/cache/cluster and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-05-15 12:07:47 -0400 (Thu, 15 May 2008)
New Revision: 5855
Added:
core/branches/2.1.X/src/test/java/org/jboss/cache/cluster/ReplicationQueueTxTest.java
Modified:
core/branches/2.1.X/src/main/java/org/jboss/cache/transaction/TransactionEntry.java
Log:
JBCACHE-1348: Use of replication queue and transactions may cause modifications not to be applied on remote nodes
Modified: core/branches/2.1.X/src/main/java/org/jboss/cache/transaction/TransactionEntry.java
===================================================================
--- core/branches/2.1.X/src/main/java/org/jboss/cache/transaction/TransactionEntry.java 2008-05-15 15:53:01 UTC (rev 5854)
+++ core/branches/2.1.X/src/main/java/org/jboss/cache/transaction/TransactionEntry.java 2008-05-15 16:07:47 UTC (rev 5855)
@@ -447,8 +447,8 @@
public void reset()
{
orderedSynchronizationHandler = null;
- modification_list.clear();
- cl_mod_list.clear();
+ modification_list = null;
+ cl_mod_list = null;
option = null;
locks.clear();
if (dummyNodesCreatedByCacheLoader != null) dummyNodesCreatedByCacheLoader.clear();
Added: core/branches/2.1.X/src/test/java/org/jboss/cache/cluster/ReplicationQueueTxTest.java
===================================================================
--- core/branches/2.1.X/src/test/java/org/jboss/cache/cluster/ReplicationQueueTxTest.java (rev 0)
+++ core/branches/2.1.X/src/test/java/org/jboss/cache/cluster/ReplicationQueueTxTest.java 2008-05-15 16:07:47 UTC (rev 5855)
@@ -0,0 +1,58 @@
+package org.jboss.cache.cluster;
+
+import org.jboss.cache.Cache;
+import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
+import org.jboss.cache.misc.TestingUtil;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import javax.transaction.TransactionManager;
+
+@Test(groups = {"functional", "transaction"})
+public class ReplicationQueueTxTest
+{
+ Cache cache, cache2;
+ TransactionManager txManager;
+
+ @BeforeMethod
+ public void setUp() throws CloneNotSupportedException
+ {
+ cache = new DefaultCacheFactory().createCache(UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.REPL_ASYNC), false);
+ cache.getConfiguration().setUseReplQueue(true);
+ cache.getConfiguration().setReplQueueInterval(100);
+ cache.getConfiguration().setReplQueueMaxElements(10);
+ cache.start();
+ cache2 = new DefaultCacheFactory().createCache(cache.getConfiguration().clone());
+
+ TestingUtil.blockUntilViewsReceived(60000, cache, cache2);
+ txManager = cache.getConfiguration().getRuntimeConfig().getTransactionManager();
+ }
+
+ @AfterMethod
+ public void tearDown()
+ {
+ TestingUtil.killCaches(cache, cache2);
+ }
+
+ public void testTransactionalReplication() throws Exception
+ {
+ // outside of tx scope
+ cache.put("/a", "k", "v");
+
+ TestingUtil.sleepThread(200);
+
+ assert cache2.get("/a", "k").equals("v");
+
+ // now, a transactional call
+ txManager.begin();
+ cache2.put("/a", "k", "v2");
+ txManager.commit();
+
+ TestingUtil.sleepThread(200);
+
+ assert cache.get("/a", "k").equals("v2");
+ }
+}
15 years, 12 months
JBoss Cache SVN: r5854 - in core/trunk/src: test/java/org/jboss/cache/cluster and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-05-15 11:53:01 -0400 (Thu, 15 May 2008)
New Revision: 5854
Added:
core/trunk/src/test/java/org/jboss/cache/cluster/ReplicationQueueTxTest.java
Modified:
core/trunk/src/main/java/org/jboss/cache/transaction/TransactionEntry.java
Log:
Better scrubbing of internals
Modified: core/trunk/src/main/java/org/jboss/cache/transaction/TransactionEntry.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/transaction/TransactionEntry.java 2008-05-15 14:26:09 UTC (rev 5853)
+++ core/trunk/src/main/java/org/jboss/cache/transaction/TransactionEntry.java 2008-05-15 15:53:01 UTC (rev 5854)
@@ -424,8 +424,8 @@
public void reset()
{
orderedSynchronizationHandler = null;
- if (modificationList != null) modificationList.clear();
- if (localModifications != null) localModifications.clear();
+ if (modificationList != null) modificationList = null;
+ if (localModifications != null) localModifications = null;
option = null;
locks.clear();
if (dummyNodesCreatedByCacheLoader != null) dummyNodesCreatedByCacheLoader.clear();
Added: core/trunk/src/test/java/org/jboss/cache/cluster/ReplicationQueueTxTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/cluster/ReplicationQueueTxTest.java (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/cluster/ReplicationQueueTxTest.java 2008-05-15 15:53:01 UTC (rev 5854)
@@ -0,0 +1,58 @@
+package org.jboss.cache.cluster;
+
+import org.jboss.cache.Cache;
+import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
+import org.jboss.cache.misc.TestingUtil;
+import org.testng.annotations.AfterMethod;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import javax.transaction.TransactionManager;
+
+@Test(groups = {"functional", "transaction"})
+public class ReplicationQueueTxTest
+{
+ Cache cache, cache2;
+ TransactionManager txManager;
+
+ @BeforeMethod
+ public void setUp() throws CloneNotSupportedException
+ {
+ cache = new DefaultCacheFactory().createCache(UnitTestCacheConfigurationFactory.createConfiguration(Configuration.CacheMode.REPL_ASYNC), false);
+ cache.getConfiguration().setUseReplQueue(true);
+ cache.getConfiguration().setReplQueueInterval(100);
+ cache.getConfiguration().setReplQueueMaxElements(10);
+ cache.start();
+ cache2 = new DefaultCacheFactory().createCache(cache.getConfiguration().clone());
+
+ TestingUtil.blockUntilViewsReceived(60000, cache, cache2);
+ txManager = cache.getConfiguration().getRuntimeConfig().getTransactionManager();
+ }
+
+ @AfterMethod
+ public void tearDown()
+ {
+ TestingUtil.killCaches(cache, cache2);
+ }
+
+ public void testTransactionalReplication() throws Exception
+ {
+ // outside of tx scope
+ cache.put("/a", "k", "v");
+
+ TestingUtil.sleepThread(200);
+
+ assert cache2.get("/a", "k").equals("v");
+
+ // now, a transactional call
+ txManager.begin();
+ cache2.put("/a", "k", "v2");
+ txManager.commit();
+
+ TestingUtil.sleepThread(200);
+
+ assert cache.get("/a", "k").equals("v2");
+ }
+}
15 years, 12 months
JBoss Cache SVN: r5853 - core/trunk/src/main/java/org/jboss/cache/interceptors.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-05-15 10:26:09 -0400 (Thu, 15 May 2008)
New Revision: 5853
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java
Log:
Fixed local mode override issues
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java 2008-05-15 14:19:56 UTC (rev 5852)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java 2008-05-15 14:26:09 UTC (rev 5853)
@@ -154,7 +154,8 @@
public Object handleDefault(InvocationContext ctx, VisitableCommand command) throws Throwable
{
- if (isLocalModeForced(ctx)) ctx.getTransactionEntry().addLocalModification((ReversibleCommand) command);
+ if (isLocalModeForced(ctx) && command instanceof ReversibleCommand)
+ ctx.getTransactionEntry().addLocalModification((ReversibleCommand) command);
return invokeNextInterceptor(ctx, command);
}
15 years, 12 months
JBoss Cache SVN: r5852 - core/trunk/src/main/java/org/jboss/cache/interceptors.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-05-15 10:19:56 -0400 (Thu, 15 May 2008)
New Revision: 5852
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/ReplicationInterceptor.java
Log:
Fixed local mode override issues
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java 2008-05-15 13:16:30 UTC (rev 5851)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/BaseRpcInterceptor.java 2008-05-15 14:19:56 UTC (rev 5852)
@@ -186,4 +186,14 @@
}
return defaultSynchronous;
}
+
+ protected boolean isLocalModeForced(InvocationContext ctx)
+ {
+ if (ctx.getOptionOverrides() != null && ctx.getOptionOverrides().isCacheModeLocal())
+ {
+ if (log.isDebugEnabled()) log.debug("LOCAL mode forced on invocation. Suppressing clustered events.");
+ return true;
+ }
+ return false;
+ }
}
\ No newline at end of file
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor.java 2008-05-15 13:16:30 UTC (rev 5851)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/InvalidationInterceptor.java 2008-05-15 14:19:56 UTC (rev 5852)
@@ -77,12 +77,6 @@
if (optimistic) txMods = new ConcurrentHashMap<GlobalTransaction, List<ReversibleCommand>>();
}
- private boolean skipInvalidation(InvocationContext ctx)
- {
- Option optionOverride = ctx.getOptionOverrides();
- return optionOverride != null && optionOverride.isCacheModeLocal() && (ctx.getTransaction() == null);
- }
-
@Override
public Object visitPutDataMapCommand(InvocationContext ctx, PutDataMapCommand command) throws Throwable
{
@@ -141,7 +135,7 @@
clone.removeModifications(entry.getLocalModifications());
command = clone;
}
- broadcastInvalidate(command.getModifications(), gtx, tx, ctx);
+ broadcastInvalidate(command.getModifications(), tx, ctx);
}
else
{
@@ -182,7 +176,7 @@
{
GlobalTransaction gtx = ctx.getGlobalTransaction();
List<ReversibleCommand> modifications = txMods.remove(gtx);
- broadcastInvalidate(modifications, gtx, tx, ctx);
+ broadcastInvalidate(modifications, tx, ctx);
if (trace) log.trace("Committing. Broadcasting invalidations.");
}
return retval;
@@ -228,13 +222,17 @@
//replicate an evict call.
for (Fqn fqn : fqns) invalidateAcrossCluster(fqn, null, isSynchronous(optionOverride), ctx);
}
+ else
+ {
+ if (isLocalModeForced(ctx)) ctx.getTransactionEntry().addLocalModification((ReversibleCommand) command);
+ }
}
return retval;
}
- private void broadcastInvalidate(List<ReversibleCommand> modifications, GlobalTransaction gtx, Transaction tx, InvocationContext ctx) throws Throwable
+ private void broadcastInvalidate(List<ReversibleCommand> modifications, Transaction tx, InvocationContext ctx) throws Throwable
{
- if (!skipInvalidation(ctx))
+ if (ctx.getTransaction() != null && !isLocalModeForced(ctx))
{
if (modifications == null || modifications.isEmpty()) return;
InvalidationFilterVisitor filterVisitor = new InvalidationFilterVisitor(modifications.size());
@@ -358,7 +356,7 @@
protected void invalidateAcrossCluster(Fqn fqn, TransactionWorkspace workspace, boolean synchronous, InvocationContext ctx) throws Throwable
{
- if (!skipInvalidation(ctx))
+ if (ctx.getTransaction() != null && !isLocalModeForced(ctx))
{
// increment invalidations counter if statistics maintained
incrementInvalidations();
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java 2008-05-15 13:16:30 UTC (rev 5851)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/OptimisticReplicationInterceptor.java 2008-05-15 14:19:56 UTC (rev 5852)
@@ -26,7 +26,6 @@
import org.jboss.cache.commands.write.RemoveDataCommand;
import org.jboss.cache.commands.write.RemoveKeyCommand;
import org.jboss.cache.commands.write.RemoveNodeCommand;
-import org.jboss.cache.config.Option;
import org.jboss.cache.factories.CommandsFactory;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.optimistic.DataVersion;
@@ -68,18 +67,6 @@
this.commandsFactory = commandsFactory;
}
- private boolean isLocalOptionOverrides(InvocationContext ctx)
- {
- Option optionOverride = ctx.getOptionOverrides();
- if (optionOverride != null && optionOverride.isCacheModeLocal() && ctx.getTransaction() == null)
- {
- // skip replication!!
- log.debug("Skipping replication for this call as cache mode is local, forced via an option override.");
- return true;
- }
- return false;
- }
-
@Override
public Object visitOptimisticPrepareCommand(InvocationContext ctx, OptimisticPrepareCommand command) throws Throwable
{
@@ -105,16 +92,11 @@
@Override
public Object visitCommitCommand(InvocationContext ctx, CommitCommand command) throws Throwable
{
- if (isLocalOptionOverrides(ctx))
- {
- return invokeNextInterceptor(ctx, command);
- }
//lets broadcast the commit first
Throwable remoteCommitException = null;
GlobalTransaction gtx = getGlobalTransaction(ctx);
if (!gtx.isRemote() && ctx.isOriginLocal() && broadcastTxs.contains(gtx))
{
- //we dont do anything
try
{
if (!skipReplicationOfTransactionMethod(ctx)) broadcastCommit(gtx, ctx);
@@ -137,10 +119,6 @@
@Override
public Object visitRollbackCommand(InvocationContext ctx, RollbackCommand command) throws Throwable
{
- if (isLocalOptionOverrides(ctx))
- {
- return invokeNextInterceptor(ctx, command);
- }
// lets broadcast the rollback first
GlobalTransaction gtx = getGlobalTransaction(ctx);
Throwable remoteRollbackException = null;
@@ -169,15 +147,18 @@
@Override
public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable
{
- if (isLocalOptionOverrides(ctx))
- {
- return invokeNextInterceptor(ctx, command);
- }
if (command.isPutForExternalRead()) ctx.getTransactionEntry().setForceAsyncReplication(true);
+ if (isLocalModeForced(ctx)) ctx.getTransactionEntry().addLocalModification(command);
return invokeNextInterceptor(ctx, command);
}
+ public Object handleDefault(InvocationContext ctx, VisitableCommand command) throws Throwable
+ {
+ if (isLocalModeForced(ctx)) ctx.getTransactionEntry().addLocalModification((ReversibleCommand) command);
+ return invokeNextInterceptor(ctx, command);
+ }
+
private GlobalTransaction getGlobalTransaction(InvocationContext ctx)
{
// get the current globalTransaction
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/ReplicationInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/ReplicationInterceptor.java 2008-05-15 13:16:30 UTC (rev 5851)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/ReplicationInterceptor.java 2008-05-15 14:19:56 UTC (rev 5852)
@@ -13,7 +13,6 @@
import org.jboss.cache.commands.write.RemoveKeyCommand;
import org.jboss.cache.commands.write.RemoveNodeCommand;
import org.jboss.cache.config.Configuration;
-import org.jboss.cache.config.Option;
import org.jboss.cache.transaction.GlobalTransaction;
import org.jboss.cache.transaction.TransactionEntry;
@@ -28,17 +27,6 @@
public class ReplicationInterceptor extends BaseRpcInterceptor
{
- protected boolean skipReplication(InvocationContext ctx)
- {
- Option optionOverride = ctx.getOptionOverrides();
- if (optionOverride != null && optionOverride.isCacheModeLocal() && ctx.getTransaction() == null)
- {
- if (trace) log.trace("skip replication");
- return true;
- }
- return false;
- }
-
@Override
public Object visitCommitCommand(InvocationContext ctx, CommitCommand command) throws Throwable
{
@@ -76,7 +64,8 @@
@Override
public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable
{
- if (skipReplication(ctx)) return invokeNextInterceptor(ctx, command);
+ boolean local = isLocalModeForced(ctx);
+ if (local && ctx.getTransaction() == null) return invokeNextInterceptor(ctx, command);
if (isTransactionalAndLocal(ctx))
{
Object returnValue = invokeNextInterceptor(ctx, command);
@@ -85,11 +74,7 @@
ctx.getTransactionEntry().setForceAsyncReplication(true);
}
- if (ctx.getOptionOverrides().isCacheModeLocal())
- {
- if (log.isDebugEnabled()) log.debug("Local mode override detected, will not replicate this command.");
- ctx.getTransactionEntry().addLocalModification(command);
- }
+ if (local) ctx.getTransactionEntry().addLocalModification(command);
return returnValue;
}
@@ -136,7 +121,8 @@
private Object handleCrudMethod(InvocationContext ctx, VisitableCommand command, boolean forceAsync)
throws Throwable
{
- if (skipReplication(ctx)) return invokeNextInterceptor(ctx, command);
+ boolean local = isLocalModeForced(ctx);
+ if (local && ctx.getTransaction() == null) return invokeNextInterceptor(ctx, command);
// FIRST pass this call up the chain. Only if it succeeds (no exceptions) locally do we attempt to replicate.
Object returnValue = invokeNextInterceptor(ctx, command);
if (ctx.getTransaction() == null && ctx.isOriginLocal())
@@ -152,11 +138,7 @@
}
else
{
- if (ctx.getOptionOverrides().isCacheModeLocal())
- {
- if (log.isDebugEnabled()) log.debug("Local mode override detected, will not replicate this command.");
- ctx.getTransactionEntry().addLocalModification((ReversibleCommand) command);
- }
+ if (local) ctx.getTransactionEntry().addLocalModification((ReversibleCommand) command);
}
return returnValue;
}
15 years, 12 months
JBoss Cache SVN: r5851 - core/trunk.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-05-15 09:16:30 -0400 (Thu, 15 May 2008)
New Revision: 5851
Modified:
core/trunk/pom.xml
Log:
Removed dependency on jboss-javaee and used jta instead
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2008-05-15 12:44:49 UTC (rev 5850)
+++ core/trunk/pom.xml 2008-05-15 13:16:30 UTC (rev 5851)
@@ -30,9 +30,9 @@
</dependency>
<dependency>
- <groupId>org.jboss.javaee</groupId>
- <artifactId>jboss-javaee</artifactId>
- <version>5.0.0.Beta3</version>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ <version>1.1</version>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
@@ -90,18 +90,6 @@
<version>1.0.0.0</version>
<optional>true</optional>
</dependency>
- <dependency>
- <groupId>net.noderunner</groupId>
- <artifactId>http</artifactId>
- <version>1.0</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.3</version>
- <scope>test</scope>
- </dependency>
<!-- test dependencies -->
<dependency>
@@ -113,7 +101,7 @@
<dependency>
<groupId>org.jboss.transaction</groupId>
<artifactId>jboss-jta</artifactId>
- <version>4.2.3.SP5</version>
+ <version>4.3.0.BETA2</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -122,6 +110,18 @@
<version>2.0b4</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>net.noderunner</groupId>
+ <artifactId>http</artifactId>
+ <version>1.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.3</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
<build>
<plugins>
@@ -433,7 +433,7 @@
<dependency>
<groupId>org.jboss.transaction</groupId>
<artifactId>jboss-jta</artifactId>
- <version>4.3.0.GA</version>
+ <version>4.3.0.BETA2</version>
<scope>test</scope>
</dependency>
</dependencies>
15 years, 12 months