Hi,
we are using hibernate 3.2.1.ga in a clustered(2 server) web application running on weblogic 9.2. We are using ehcache 1.3.0 as clustered cache provider.
After a while (e.g 5-10 days or so) it happens that some threads getting stuck while doing lazy loading which cause then a continuesly increasing CPU usage on that machine. At least we have to restart the cluster instance.
We've done a thread dump to analysed the trace and saw that the threads always getting stuck at the same two places. These are:
Code:
"[STUCK] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'" daemon prio=1 tid=0x01703558 nid=0x2a runnable
[0xa55fd000..0xa55ffb10]
at java.util.HashMap.put(HashMap.java:385)
at org.hibernate.engine.StatefulPersistenceContext.addCollection(StatefulPersistenceContext.java:679)
at org.hibernate.engine.StatefulPersistenceContext.addUninitializedCollection(StatefulPersistenceContext.java:652)
at org.hibernate.type.CollectionType.getCollection(CollectionType.java:540)
at org.hibernate.type.CollectionType.resolveKey(CollectionType.java:346)
at org.hibernate.type.CollectionType.assemble(CollectionType.java:238)
at org.hibernate.type.TypeFactory.assemble(TypeFactory.java:400)
at org.hibernate.cache.entry.CacheEntry.assemble(CacheEntry.java:96)
at org.hibernate.cache.entry.CacheEntry.assemble(CacheEntry.java:82)
at org.hibernate.event.def.DefaultLoadEventListener.assembleCacheEntry(DefaultLoadEventListener.java:553)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromSecondLevelCache(DefaultLoadEventListener.java:508)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:357)
...
and
Code:
"[STUCK] ExecuteThread: '14' for queue: 'weblogic.kernel.Default (self-tuning)'" daemon prio=1 tid=0x030e9a70 nid=0x329 runnable [0x958fd000..0x958ffa90]
at java.util.HashMap.get(HashMap.java:329)
at org.apache.commons.collections.SequencedHashMap.put(Unknown Source)
at org.hibernate.util.IdentityMap.put(IdentityMap.java:140)
at org.hibernate.engine.StatefulPersistenceContext.addEntry(StatefulPersistenceContext.java:428)
at org.hibernate.engine.StatefulPersistenceContext.addEntity(StatefulPersistenceContext.java:382)
at org.hibernate.engine.TwoPhaseLoad.addUninitializedCachedEntity(TwoPhaseLoad.java:263)
at org.hibernate.event.def.DefaultLoadEventListener.assembleCacheEntry(DefaultLoadEventListener.java:542)
at org.hibernate.event.def.DefaultLoadEventListener.loadFromSecondLevelCache(DefaultLoadEventListener.java:508)
at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:357)
...
Does anybody have an idea why this threads get stuck when java.util.HashMap.put is called? Is this a synchronization problem in hibernate? If so is this fixed in a newer version?
Thanks for your help.
MS