-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Issue with Hibernate - StaleStateException
PostPosted: Tue Jul 24, 2012 8:39 am 
Newbie

Joined: Tue Jul 24, 2012 8:18 am
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.