Sorry, i messed up my term there. I am using the Disconnected Session Model. I use one session to Load the dataobject. Then allow the user multiple user transactions to modify the data. When they are ready to save i open a new session and session.update()
Hibernate is trying to persist the data, but the order it preforms the opperations is incorrect. Its causing a contraint violation by trying to insert before it deletes.
I have tried keeping the 1st session and just .disconnect() after querying, then when ready to save .reconnect() .update() .flush() But hibernate still does the same thing.
I have reviewed a Hibernate book and it lists the order of operations as
1. Entity Insertion
2. Entity Updates
3. Collection Deletion
4. Collection elements deletions,updates,insertions
5. Collection insertions
6. Entity Deletions
My problem is that #4 does not seam to work that way, it is doing them in reverse order. Its inserting updating and then deleting
[25/08/05 12:19:21:215 EST] 22652265 SystemOut O Hibernate: insert into Quotes.PROJECTDEFAULTFACTORIES (ID_FACTORY, ID_PROJECT, ID_Contact, ID_DEFAULTFACTORYMAP) values (?, ?, ?, default)
[25/08/05 12:19:21:231 EST] 22652265 SystemOut O Hibernate: values identity_val_local()
[25/08/05 12:19:21:247 EST] 22652265 SystemOut O Hibernate: update Quotes.PROJECTDEFAULTQUANTATIES set QUANTITY=?, DISABLED=?, SHOWTIMELINE=?, PROJECTID=?, TIMELINEID=? where QUANTITYID=?
[25/08/05 12:19:21:247 EST] 22652265 SystemOut O Hibernate: update Quotes.PROJECTDEFAULTQUANTATIES set QUANTITY=?, DISABLED=?, SHOWTIMELINE=?, PROJECTID=?, TIMELINEID=? where QUANTITYID=?
[25/08/05 12:19:21:247 EST] 22652265 SystemOut O Hibernate: delete from Quotes.PROJECTDEFAULTFACTORIES where ID_DEFAULTFACTORYMAP=?
Thanks
Dave
|