Author: rmannibucau
Date: Mon May 12 20:41:11 2014
New Revision: 1594082

URL: http://svn.apache.org/r1594082
Log:
TOMEE-1203 stateful are locked to be thread safe but we shouldn't fail if 
checkouted by multiple threads - to test against tcks

Modified:
    
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/managed/SimpleCache.java
    
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/SimpleCache.java

Modified: 
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/managed/SimpleCache.java
URL: 
http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/managed/SimpleCache.java?rev=1594082&r1=1594081&r2=1594082&view=diff
==============================================================================
--- 
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/managed/SimpleCache.java
 (original)
+++ 
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/managed/SimpleCache.java
 Mon May 12 20:41:11 2014
@@ -172,7 +172,8 @@ public class SimpleCache<K, V> implement
                     case AVAILABLE:
                         break;
                     case CHECKED_OUT:
-                        throw new IllegalStateException("The entry " + key + " 
is already checked-out");
+                        return entry.getValue();
+                        // throw new IllegalStateException("The entry " + key 
+ " is already checked-out");
                     case PASSIVATED:
                         // Entry was passivated between get and lock, we need 
to load the Entry again
                         // If the cache somehow got corrupted by an entry 
containing in state PASSIVATED, this remove

Modified: 
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/SimpleCache.java
URL: 
http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/SimpleCache.java?rev=1594082&r1=1594081&r2=1594082&view=diff
==============================================================================
--- 
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/SimpleCache.java
 (original)
+++ 
tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/SimpleCache.java
 Mon May 12 20:41:11 2014
@@ -255,7 +255,7 @@ public class SimpleCache<K, V> implement
                     case AVAILABLE:
                         break;
                     case CHECKED_OUT:
-                        throw new IllegalStateException("The entry " + key + " 
is already checked-out");
+                        return entry.getValue(); //throw new 
IllegalStateException("The entry " + key + " is already checked-out");
                     case PASSIVATED:
                         // Entry was passivated between get and lock, we need 
to load the Entry again
                         // If the cache somehow got corrupted by an entry 
containing in state PASSIVATED, this remove


Reply via email to