net.sf.hibernate.HibernateException: You may not change the reference to a collection with cascade="all-delete-orphan"

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

Solutions on the web

via Hibernate JIRA by Martin Hackmann, 1 year ago
You may not change the reference to a collection with cascade="all-delete-orphan"
via Hibernate JIRA by Martin Hackmann, 1 year ago
You may not change the reference to a collection with cascade="all-delete-orphan"
net.sf.hibernate.HibernateException: You may not change the reference to a collection with cascade="all-delete-orphan"
at net.sf.hibernate.impl.SessionImpl.prepareCollectionForUpdate(SessionImpl.java:2949)
at net.sf.hibernate.impl.SessionImpl.updateReachableCollection(SessionImpl.java:2886)
at net.sf.hibernate.impl.FlushVisitor.processCollection(FlushVisitor.java:32)
at net.sf.hibernate.impl.AbstractVisitor.processValue(AbstractVisitor.java:69)
at net.sf.hibernate.impl.AbstractVisitor.processValues(AbstractVisitor.java:36)
at net.sf.hibernate.impl.SessionImpl.flushEntity(SessionImpl.java:2588)
at net.sf.hibernate.impl.SessionImpl.flushEntities(SessionImpl.java:2454)
at net.sf.hibernate.impl.SessionImpl.flushEverything(SessionImpl.java:2256)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2235)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
at test.TestParent.main(TestParent.java:108)

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.

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