Hi All,
There are two peculiar issues I am facing with Hibernate -
1) I was using Hibernate3 with Jdk1.4 and have recently upgraded to Jdk1.6. So the current setup is Hibernate3 with Jdk1.4. When trying to do a batch delete (session.delete) now I am getting StaleStateException which however was working fine with Jdk1.4, haven't made any changes to the code whatsoever. I am doubting that it may be related to Hibernate version as well, I might need an upgrade of Hibernate as well. Any suggestion/comment invited.
2) As a part of functionality I am merging a record from a base table to target table and I am deleting the record from the base table using hibernate. So, to resolve the first issue what I did was- I placed a merge(session.merge) before delete(session.delete). Now delete here works fine however Hibernate is trying to insert a record into target table taking values from base table for the record which we deleted. which is in turn giving error that the input record is not found. And I can see the record from base table merged into the target table, so basically no information loss however since it is doing an extra insert of a record which was deleted, my application is breaking.
I would be happy to post any detail required.
In case I have posted this in wrong forum, please suggest the correct forum. Also, Please guide me to the page where it has been already answered/ similar issue answered if has already been answered.
Regards, Abhishek
|