Index: IdentityMapAccessor.java =================================================================== RCS file: /cvs/glassfish/entity-persistence/src/java/oracle/toplink/essentials/internal/sessions/IdentityMapAccessor.java,v retrieving revision 1.9 diff -u -r1.9 IdentityMapAccessor.java --- IdentityMapAccessor.java 22 Aug 2007 20:57:31 -0000 1.9 +++ IdentityMapAccessor.java 9 Apr 2008 15:04:47 -0000 @@ -623,16 +623,17 @@ public void invalidateClass(Class myClass, boolean recurse) { //forward the call to getIdentityMap locally in case subclasses overload IdentityMap identityMap = this.getIdentityMap(myClass); - synchronized (identityMap) { - Enumeration keys = identityMap.keys(); + //removed synchronization that would result in deadlock + //no need to synchronize as changes to identity map will not aversely + //affect this code + Enumeration keys = identityMap.keys(); + + while (keys.hasMoreElements()) { + CacheKey key = (CacheKey)keys.nextElement(); + Object obj = key.getObject(); - while (keys.hasMoreElements()) { - CacheKey key = (CacheKey)keys.nextElement(); - Object obj = key.getObject(); - - if (recurse || ((obj != null) && obj.getClass().equals(myClass))) { - key.setInvalidationState(CacheKey.CACHE_KEY_INVALID); - } + if (recurse || ((obj != null) && obj.getClass().equals(myClass))) { + key.setInvalidationState(CacheKey.CACHE_KEY_INVALID); } } }