-->
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.  [ 3 posts ] 
Author Message
 Post subject: exception while deleting and creating in same session
PostPosted: Wed Mar 07, 2012 9:27 am 
Newbie

Joined: Wed Mar 07, 2012 9:18 am
Posts: 2
Hi Experts,

I am using Hibernate 3.0.
I open a session and then I delete an entity and save new entity (with identical values but with no id and version) in the same session. it gives exception. it complains about a unique key getting violated. Which should only happen If I save and then delete. But I am deleting, then doing a session.flush() and then session.clear() and then saving an identical entity (without any id and version). I am getting error.

Please suggest what mistake I am making here.

Thanks,
Pushker


Top
 Profile  
 
 Post subject: Re: exception while deleting and creating in same session
PostPosted: Wed Mar 07, 2012 12:09 pm 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Hm, it's hard to say what's happening in detail.
I suggest you to log all jdbc-activities with p6spy (including schema-generation if possible) and then report the log here.
Then surely I can tell you more.


Top
 Profile  
 
 Post subject: Re: exception while deleting and creating in same session
PostPosted: Wed Mar 07, 2012 11:54 pm 
Newbie

Joined: Wed Mar 07, 2012 9:18 am
Posts: 2
Hi

The issue has been resolved. It was a little mistake.

Thanks,
Pushker


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

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.