-->
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: When do I get StaleObjectException?
PostPosted: Mon Aug 02, 2004 1:34 am 
Beginner
Beginner

Joined: Wed Jul 21, 2004 7:48 am
Posts: 21
Hi guys,
I am using Hibernate 2.1.2
I am using @hibernate.timestamp as a way for auditing and ensure that the user has the latest data before he updates it.
I successfully incorporated this tag and run my application. But I want to know when that StaleObjectException is going to be caught?.
I dint understand clearly by Hibernate doc that states StaleObjectException is thrown when the Session contains the stale data.So how can I make the Session contain the stale data? Just I want to catch StaleObjectException want to know whats the database state should be.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 02, 2004 2:53 am 
Expert
Expert

Joined: Fri Feb 06, 2004 7:49 am
Posts: 255
Location: Moscow, Russia
in that thread http://forum.hibernate.org/viewtopic.php?t=933019, read my latest message.
Code:
update User set name='new name' version=3 where userId=123 and version=2
return value should be 1, not 0, else you will get StaleObjectStateException.

--
Leonid


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.