[jboss-cvs] JBossCache/src/org/jboss/cache/interceptors ...
Brian Stansberry
brian.stansberry at jboss.com
Thu Jul 20 22:51:29 EDT 2006
User: bstansberry
Date: 06/07/20 22:51:29
Modified: src/org/jboss/cache/interceptors Tag:
Branch_JBossCache_1_4_0_MUX TxInterceptor.java
DataGravitatorInterceptor.java
Log:
Sync to JBossCache_1_4_0_GA
Revision Changes Path
No revision
No revision
1.48.4.1 +25 -17 JBossCache/src/org/jboss/cache/interceptors/TxInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TxInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/TxInterceptor.java,v
retrieving revision 1.48
retrieving revision 1.48.4.1
diff -u -b -r1.48 -r1.48.4.1
--- TxInterceptor.java 8 Jun 2006 22:00:35 -0000 1.48
+++ TxInterceptor.java 21 Jul 2006 02:51:29 -0000 1.48.4.1
@@ -703,17 +703,25 @@
}
catch (Throwable e)
{
- log.error("Commit failed, rolling back.", e);
+ log.warn("Commit failed. Clearing stale locks.");
try
{
- tx.setRollbackOnly();
+ cleanupStaleLocks(gtx);
}
- catch (Exception e2)
+ catch (Throwable e2)
{
- log.error("Unable to roll back transaction", e2);
+ log.error("Unable to clear stale locks", e2);
+ throw new RuntimeException(e2);
+ }
+ throw new RuntimeException("Commit failed.", e);
}
- throw new RuntimeException("Commit failed, marking tx to be rolled back.", e);
}
+
+
+ private void cleanupStaleLocks(GlobalTransaction gtx) throws Throwable
+ {
+ TransactionEntry entry = txTable.get(gtx);
+ entry.releaseAllLocksLIFO(gtx);
}
/**
1.16.4.1 +8 -11 JBossCache/src/org/jboss/cache/interceptors/DataGravitatorInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: DataGravitatorInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/DataGravitatorInterceptor.java,v
retrieving revision 1.16
retrieving revision 1.16.4.1
diff -u -b -r1.16 -r1.16.4.1
--- DataGravitatorInterceptor.java 6 Jun 2006 10:17:14 -0000 1.16
+++ DataGravitatorInterceptor.java 21 Jul 2006 02:51:29 -0000 1.16.4.1
@@ -35,16 +35,14 @@
import java.util.Vector;
/**
- * The Data Gravitator is a type of cache loader that queries the cluster for data. Behaviourally very similar to
- * {@see ClusteredCacheLoader} which it extends, it adds on further semantics specific to data gravitation.
- * <p />
- * Optional config properties such as:
- * <ul>
- * <li>removeOnFind - defaults to true, forces all remote caches that own the data or hold backups for the data to remove that data,
- * thereby making the requesting cache the new data owner. If set to false an evict is broadcast instead of a remove, so any state
- * persisted in cache loaders will remain. This is useful if you have a shared cache loader configured.</li>
- * <li>searchBackupTrees - defaults to true, causes remote caches to search through their backup subtrees in addition to their main data trees.</li>
- * </ul>
+ * The Data Gravitator interceptor intercepts cache misses and attempts t gravitate data from other parts of the cluster.
+ *
+ * Only used if Buddy Replication is enabled. Also, the interceptor only kicks in if an {@link Option} is passed in to
+ * force Data Gravitation for a specific invocation or if <b>autoDataGravitation</b> is set to <b>true</b> when configuring
+ * Buddy Replication.
+ *
+ * See the JBoss Cache User Guide for more details on configuration options. There is a section dedicated to Buddy Replication
+ * in the Replication chapter.
*
* @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
*/
@@ -107,7 +105,6 @@
{
// create node locally so I don't gravitate again
// when I do the put() call to the cluster!
- // FIXME -- need to be able to suppress gravitation!!!
createNode(true, data.backupData);
// Make sure I replicate to my buddies.
log.trace("Passing the put call locally to make sure state is persisted and ownership is correctly established.");
More information about the jboss-cvs-commits
mailing list