-->
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.  [ 4 posts ] 
Author Message
 Post subject: Batch update returned unexpected row count from update [0];
PostPosted: Fri Mar 13, 2009 12:25 pm 
Beginner
Beginner

Joined: Wed Jan 28, 2009 10:16 am
Posts: 37
Hello,


I already see post about this problem, it was said that it can due to transaction and session because the object are already in data base or not.
The problem is that I have an interceptor that manage the transaction and the session, so that is not the problem !!?

In fact I have an entry, when I update it, it is ok, but if I delete it and then I try to save it, this problem occurs?

Have you any idea to solve this problem ?


Top
 Profile  
 
 Post subject: Re: Batch update returned unexpected row count from update [
PostPosted: Fri Mar 13, 2009 1:24 pm 
Newbie

Joined: Fri Mar 13, 2009 1:15 pm
Posts: 1
I have similar problem. I verified that hibernate session is closed and there is no session leak. However, once the problem occurs, it stay there forever, for all new transaction and new session.

So it does not seems to me the problem of session cache. Is there a global cache in hibernate? If yes, how can I clear it?

The problem has haunted me for quite some time, very difficult to reproduce, and difficult to get rid of it once occurred.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 13, 2009 8:28 pm 
Beginner
Beginner

Joined: Wed Dec 17, 2008 12:10 pm
Posts: 47
What method are you calling to persist the object. This sounds like you're trying to call Session.update on an object that has not been persisted yet. Try saveOrUpdate.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 16, 2009 3:49 am 
Beginner
Beginner

Joined: Wed Jan 28, 2009 10:16 am
Posts: 37
Precisely, I am using saveOrUpdate to persist my data !

In my case, I can reproduce the action.
In fact, I have save an entry in my data base (this entry = object with a collection of string).
If I import the same object (this must be updated). It works...

But if I delete the entry and just after I get the same objet and I try to save it, the error occurs...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.