We use hibernate 4.3.8.Final, Spring4 and Java7.
A few times a day we have an issue that a few threads just hangs forever in HashMap.getEntry(), see StackTrace from ThreadDump
"catalina77" daemon prio=10 tid=0x00007fa600086800 nid=0x28b7 runnable [0x00007fa5cc6c1000]
java.lang.Thread.State: RUNNABLE
at java.util.HashMap.getEntry(HashMap.java:465)
at java.util.HashMap.get(HashMap.java:417)
at org.hibernate.engine.internal.StatefulPersistenceContext.getEntity(StatefulPersistenceContext.java:393)
at ...
This can only happen because the underlying HashMap is used by two different Threads. As HashMap is not thread-safe the method loops forever because of e = e.next
in HashMap Line 465
I am pretty sure that we have two Threads which use the same Hibernate Session.