This content has been marked as final.
Show 2 replies
-
1. Re: EntityHome + nested persist = FK constraint violation
damianharvey May 10, 2007 12:15 PM (in response to damianharvey)Additionally Hibernate is logging the insert:
[STDOUT] Hibernate: insert into USER (...etc etc
-
2. [RESOLVED] EntityHome + nested persist = FK constraint viola
damianharvey May 15, 2007 4:23 AM (in response to damianharvey)This was caused by my Entities not having their auto-incrementing IDs annotated with @GeneratedValue.
It makes sense in hindsight, but the symptoms were odd. I'm still not sure why the flush() didn't work.
I had changed my method to have the FlushModeType.MANUAL but the entityManager.flush() was still not hitting the database. The flush() method must have an active transaction otherwise it will be ignored. If using a POJO what is the reccommended way to get this working? Is the Seam Managed Transaction sufficient for the flush (ie. so it's not ignored)?