-->
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: iterate inconsistency risk?
PostPosted: Mon Mar 22, 2004 6:23 am 
Newbie

Joined: Mon Mar 22, 2004 5:45 am
Posts: 8
Location: Prague, Czech Republic
Hello,
this is just an idea, not tested nor verified, but I'd like to know your opinion.

The iterate method returns list of found objects - it fetches primary keys from the databse of objects to be further retrieved.

select id from table where some_condition

Then, when some object in the iterator is to be used, query is issued to fetch the properties of the object using the following query.

select field1,field2,field3 ... from table where id=123141241

It seems OK, but how about in concurrent environment.
What if the record id=123141241 no longer satisfies the some_condition?

Obviously, one gets object that no longer satisfies the query conditions.
Perhaps, it is ment to be up to the developer to be careful in such situation, but then it should be stressed in documentation that this might happen.

Any comments welcomed.

Marcel

_________________
Marcel Kruzel
Trema (Czech Republic)
www.trema.com


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 22, 2004 6:30 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Depends upon isolation level. If you care, use repeatable read.


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.