org.hibernate.HibernateException: Illegal attempt to associate a collection with two open sessions

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

Do you know how to solve this issue? Write a tip to help other users and build your expert profile.

Solutions on the web

via Atlassian JIRA by Bryan Turner, 1 year ago
Illegal attempt to associate a collection with two open sessions
via atlassian.com by Unknown author, 1 year ago
Illegal attempt to associate a collection with two open sessions
via Atlassian JIRA by Bryan Turner, 1 year ago
Illegal attempt to associate a collection with two open sessions
via Stack Overflow by pitschr
, 2 years ago
Illegal attempt to associate a collection with two open sessions
org.hibernate.HibernateException: Illegal attempt to associate a collection with two open sessions
at org.hibernate.collection.internal.AbstractPersistentCollection.setCurrentSession(AbstractPersistentCollection.java:633)
at org.hibernate.event.internal.OnUpdateVisitor.processCollection(OnUpdateVisitor.java:63)
at org.hibernate.event.internal.AbstractVisitor.processValue(AbstractVisitor.java:121)
at org.hibernate.event.internal.AbstractVisitor.processValue(AbstractVisitor.java:82)
at org.hibernate.event.internal.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:76)
at org.hibernate.event.internal.AbstractVisitor.process(AbstractVisitor.java:143)
at org.hibernate.event.internal.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:120)
at org.hibernate.event.internal.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:73)
at org.hibernate.internal.SessionImpl.fireDelete(SessionImpl.java:920)
at com.atlassian.crowd.util.persistence.hibernate.batch.hibernate4.operation.RemoveGroupOperation.performOperation(RemoveGroupOperation.java:43)
at com.atlassian.crowd.util.persistence.hibernate.batch.hibernate4.operation.RemoveGroupOperation.performOperation(RemoveGroupOperation.java:17)
at com.atlassian.crowd.util.persistence.hibernate.batch.AbstractBatchProcessor.performOperation(AbstractBatchProcessor.java:212)
at com.atlassian.crowd.util.persistence.hibernate.batch.AbstractBatchProcessor.processIndividual(AbstractBatchProcessor.java:184)
at com.atlassian.crowd.util.persistence.hibernate.batch.AbstractBatchProcessor.processBatch(AbstractBatchProcessor.java:168)
at com.atlassian.crowd.util.persistence.hibernate.batch.AbstractBatchProcessor.execute(AbstractBatchProcessor.java:133)
at com.atlassian.crowd.dao.group.GroupDAOHibernate.removeAllGroups(GroupDAOHibernate.java:237)
at com.atlassian.crowd.directory.AbstractInternalDirectory.removeAllGroups(AbstractInternalDirectory.java:767)
at com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.deleteCachedGroups(DbCachingRemoteChangeOperations.java:690)
at com.atlassian.crowd.directory.DbCachingRemoteChangeOperations.deleteCachedGroupsNotIn(DbCachingRemoteChangeOperations.java:679)
at com.atlassian.crowd.directory.$Proxy1997.deleteCachedGroupsNotIn(Unknown Source)
at com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations.deleteCachedGroupsNotIn(DirectoryCacheImplUsingChangeOperations.java:99)
at com.atlassian.crowd.directory.ldap.cache.RemoteDirectoryCacheRefresher.synchroniseAllGroups(RemoteDirectoryCacheRefresher.java:113)
at com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher.synchroniseAll(AbstractCacheRefresher.java:82)
at com.atlassian.crowd.directory.ldap.cache.EventTokenChangedCacheRefresher.synchroniseAll(EventTokenChangedCacheRefresher.java:66)
at com.atlassian.crowd.directory.DbCachingRemoteDirectory.synchroniseCache(DbCachingRemoteDirectory.java:1120)
at com.atlassian.crowd.manager.directory.DirectorySynchroniserImpl.synchronise(DirectorySynchroniserImpl.java:76)

Users with the same issue

Once, 5 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.