tdraier 2005/04/27 18:46:56 CEST
Modified files: (Branch: JAHIA-4-1-BRANCH)
src/java/org/jahia/services/webdav/stores CachedStore.java
Log:
reset cache in case of rollbacks
Revision Changes Path
1.7.4.5.2.4 +22 -15
jahia/src/java/org/jahia/services/webdav/stores/CachedStore.java
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/src/java/org/jahia/services/webdav/stores/CachedStore.java.diff?r1=1.7.4.5.2.3&r2=1.7.4.5.2.4&f=h
Index: CachedStore.java
===================================================================
RCS file:
/home/cvs/repository/jahia/src/java/org/jahia/services/webdav/stores/Attic/CachedStore.java,v
retrieving revision 1.7.4.5.2.3
retrieving revision 1.7.4.5.2.4
diff -u -r1.7.4.5.2.3 -r1.7.4.5.2.4
--- CachedStore.java 27 Apr 2005 09:21:59 -0000 1.7.4.5.2.3
+++ CachedStore.java 27 Apr 2005 16:46:55 -0000 1.7.4.5.2.4
@@ -13,6 +13,8 @@
import org.jahia.services.cache.CacheEntry;
import org.jahia.services.cache.CacheFactory;
+import javax.transaction.xa.Xid;
+import javax.transaction.xa.XAException;
import java.util.Date;
import java.util.Enumeration;
import java.util.Vector;
@@ -706,23 +708,9 @@
/**
- * Delist (suspend) the resource manager in the current transaction.
- */
- protected void delist (Service service, boolean success)
- throws ServiceAccessException {
- if (!success) {
- // If there's a failure which will cause the transaction to be
- // rollbacked, flush the caches
- resetCaches ();
- }
- super.delist (service, success);
- }
-
-
- /**
* Reset the caches.
*/
- protected void resetCaches () throws ServiceAccessException {
+ protected void resetCaches () {
internalCache.flush ();
}
@@ -756,4 +744,23 @@
}
}
+ public void rollback(Xid xid) throws XAException {
+ resetCaches();
+ super.rollback(xid);
+ }
+
+ protected void enlist(Service service) throws ServiceAccessException {
+ if (service instanceof JahiaDescriptorsStore) {
+ super.enlist(this);
+ }
+ super.enlist(service);
+ }
+
+ protected void delist(Service service, boolean b) throws
ServiceAccessException {
+ super.delist(service, b);
+ if (service instanceof JahiaDescriptorsStore) {
+ super.delist(this, b);
+ }
+ }
+
}