|
This issue is a bit old, but we never found a discussion of possible causes so thought we would relay our experiences.
We had a very similar issue where two concurrent threads would enter an infinite loop of HashMap.put, caused by multi-thread access of a single StatefulPersistenceContext. After much debugging, we stepped back to realize we were caching a Hibernate object in a vanilla ehCache (via @Cacheable) used across requests. Since the actual cached value was not Hibernate-managed, we missed the fact that it contained a Hibernate entity deep in its object graph for quite a while. Since each request had an underlying Hibernate session, there was not a "no hibernate session bound to current thread" exception.
All credit goes to my colleague Jon Riegel.
|