well I determined the root cause of the exception I was getting 
(org.hibernate.PersistentObjectException: detached entity passed to persist: 
com.cox.beans.entity.TblSecurityAuditNote).  It was that I had a loop that was 
trying to persist an already perstisted/inserted JPA entity into the DB and 
Hibernate notices this and throws the exception before you get a primary key 
violation SQLException from DB.

So in my case it was a programmer's error. The fix was to set the already 
persisted entity to null in the array so in the code it will not exec the 
em.persiste(note) again.

I think that the wording of the hibernate exception could be more clear.  I 
still don't understand exactly what it's trying to indicate literally (I now 
know it's saying you're trying to insert a record in the table which has an 
existing primary key value).

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114996#4114996

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114996
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to