[jbosscache-commits] JBoss Cache SVN: r7115 - core/trunk/src/main/java/org/jboss/cache/loader/bdbje.
jbosscache-commits at lists.jboss.org
jbosscache-commits at lists.jboss.org
Tue Nov 11 15:44:44 EST 2008
Author: mircea.markus
Date: 2008-11-11 15:44:44 -0500 (Tue, 11 Nov 2008)
New Revision: 7115
Modified:
core/trunk/src/main/java/org/jboss/cache/loader/bdbje/BdbjeCacheLoader.java
Log:
fixed test
Modified: core/trunk/src/main/java/org/jboss/cache/loader/bdbje/BdbjeCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/bdbje/BdbjeCacheLoader.java 2008-11-11 20:37:22 UTC (rev 7114)
+++ core/trunk/src/main/java/org/jboss/cache/loader/bdbje/BdbjeCacheLoader.java 2008-11-11 20:44:44 UTC (rev 7115)
@@ -43,6 +43,7 @@
import org.jboss.cache.CacheSPI;
import org.jboss.cache.Fqn;
import org.jboss.cache.Modification;
+import org.jboss.cache.marshall.NodeData;
import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfig;
import org.jboss.cache.loader.AbstractCacheLoader;
import org.jboss.cache.util.reflect.ReflectionUtil;
@@ -123,7 +124,39 @@
checkNotOpen();
}
+ protected void storeStateHelper(Fqn subtree, List nodeData, boolean moveToBuddy) throws Exception
+ {
+ for (Object aNodeData : nodeData)
+ {
+ NodeData nd = (NodeData) aNodeData;
+ if (nd.isMarker())
+ {
+ if (log.isTraceEnabled()) log.trace("Reached delimiter; exiting loop");
+ break;
+ }
+ Fqn fqn;
+ if (moveToBuddy)
+ {
+ fqn = buddyFqnTransformer.getBackupFqn(subtree, nd.getFqn());
+ }
+ else
+ {
+ fqn = nd.getFqn();
+ }
+ if (log.isTraceEnabled()) log.trace("Storing state in Fqn " + fqn);
+ if (nd.getAttributes() != null)
+ {
+ this.put(fqn, nd.getAttributes(), true);// creates a node with 0 or more attributes
+ }
+ else
+ {
+ this.put(fqn, null);// creates a node with null attributes
+ }
+ }
+ }
+
+
/**
* Opens the JE environment and the database specified by the configuration
* string. The environment and databases are created if necessary.
@@ -874,10 +907,16 @@
{
checkNonNull(tx, "tx");
}
- if (!transactional)
+ if (!transactional & !onePhase)
{
throw new UnsupportedOperationException(
"prepare() not allowed with a non-transactional cache loader");
+ } else if (onePhase)
+ {
+ for (Modification modification: modifications)
+ {
+
+ }
}
Transaction txn = performTransaction(modifications);
if (onePhase)
More information about the jbosscache-commits
mailing list