Author: jason.greene(a)jboss.com
Date: 2009-02-13 10:55:43 -0500 (Fri, 13 Feb 2009)
New Revision: 7690
Modified:
core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferGenerator.java
Log:
Fix over-eager deactivation
Modified:
core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferGenerator.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferGenerator.java 2009-02-13
15:21:46 UTC (rev 7689)
+++
core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferGenerator.java 2009-02-13
15:55:43 UTC (rev 7690)
@@ -26,7 +26,6 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -87,6 +86,7 @@
boolean generatePersistent, boolean suppressErrors) throws
Exception
{
Fqn fqn = getFqn(rootNode);
+ boolean activated = false;
try
{
cache.getMarshaller().objectToObjectStream(STATE_TRANSFER_VERSION, out);
@@ -94,7 +94,8 @@
{
if (nonBlocking)
{
- if (! txLog.activate())
+ activated = txLog.activate();
+ if (! activated)
throw new CacheException("Busy performing state transfer for
someone else");
if (log.isTraceEnabled())
@@ -155,7 +156,7 @@
}
finally
{
- if (nonBlocking)
+ if (activated)
txLog.deactivate();
}
}
Show replies by date