tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From genspr...@apache.org
Subject svn commit: r1134505 - in /openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core: managed/SimpleCache.java stateful/SimpleCache.java
Date Sat, 11 Jun 2011 02:10:13 GMT
Author: genspring
Date: Sat Jun 11 02:10:13 2011
New Revision: 1134505

URL: http://svn.apache.org/viewvc?rev=1134505&view=rev
Log:
OPENEJB-1574  Check if a AVAILABLE state entry is in cache before throwing out the IllegalStateException.

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

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/managed/SimpleCache.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/managed/SimpleCache.java?rev=1134505&r1=1134504&r2=1134505&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/managed/SimpleCache.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/managed/SimpleCache.java
Sat Jun 11 02:10:13 2011
@@ -216,7 +216,12 @@ public class SimpleCache<K, V> implement
             // verfiy state
             switch (entry.getState()) {
                 case AVAILABLE:
-                    throw new IllegalStateException("The entry " + key + " is not checked-out");
+                    if (lru.contains(entry)) {
+                        entry.resetTimeOut();
+                        return;
+                    } else {
+                        throw new IllegalStateException("The entry " + key + " is not checked-out");
+                    }
                 case PASSIVATED:
                     // An entry in-use should not be passivated so we can only assume
                     // that the caller never checked out the bean in the first place

Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/SimpleCache.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/SimpleCache.java?rev=1134505&r1=1134504&r2=1134505&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/SimpleCache.java
(original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/SimpleCache.java
Sat Jun 11 02:10:13 2011
@@ -277,7 +277,12 @@ public class SimpleCache<K, V> implement
             // verfiy state
             switch (entry.getState()) {
                 case AVAILABLE:
-                    throw new IllegalStateException("The entry " + key + " is not checked-out");
+                    if (lru.contains(entry)) {
+                        entry.resetTimeOut();
+                        return;
+                    } else {
+                        throw new IllegalStateException("The entry " + key + " is not checked-out");
+                    }
                 case PASSIVATED:
                     // An entry in-use should not be passivated so we can only assume
                     // that the caller never checked out the bean in the first place



Mime
View raw message