PersistentObjectException: detached entity passed to persist thrown by JPA and Hibernate

The solution is simple, just use the CascadeType.MERGE instead of CascadeType.PERSIST or CascadeType.ALL.

I have had the same problem and CascadeType.MERGE has worked for me.

I hope you are sorted.

Leave a Comment