-->
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.  [ 2 posts ] 
Author Message
 Post subject: Row was updated or deleted by another transaction
PostPosted: Fri Jan 13, 2006 7:04 am 
Newbie

Joined: Mon Jul 25, 2005 4:42 am
Posts: 2
I just wanted to write about what was happening to me with this exception: net.sf.hibernate.StaleObjectStateException. It threw this message:
Row was updated or deleted by another transaction

I think that this exception can be thrown in this case and I was going mad with it:
1) Open a session to make an hibernate query
2) Execute a query wich returns a result (using the session, of course). Suppose I am getting a collection of 'Orders', for example.
3) Make a new insertion using the session. This insertion changes the result of the previous query. With the same example, suppose I have inserted in the session a new 'Order'
4)Using the same session again, execute the same query that in 2)

The exception is thrown then.

I hope it helps to someone.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 13, 2006 8:01 am 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
you open new session in 4) and don't close session and transaction in 3 (probably) or exists another user which do dml


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