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.  [ 1 post ] 
Author Message
 Post subject: Help with understanding of Future queries
PostPosted: Wed Mar 17, 2010 11:00 am 
Newbie

Joined: Tue Apr 15, 2008 7:56 am
Posts: 6
Hi,

I'm new to the usage of future queries, but from my understanding, is that if you use future instead of issuing the query right away, you can batch the queries. Thereby saving roundtrips to the database.


But, i have a issue where i get undeterministic results, when doing this. It doesn't get the same results, if i loop the same 2 future queries twice.

1 of the future queries is missing a result, but if i debug the code, and let it do the queries twice, it returns correct.

This is how the code looks:

Issue Future Query 1
Issue Future Query 2
Iterate result from Query 1
Iterate result from Query 2( A resultset is missing, 6 out of 7 returned.)

now drag the pointer in debugger to "Issue Future Query 1" and it runs the same code but returns the correct result from the database.

If i do the same thing, without futures, it behaves correctly.

The sql generated is correct with futures, returns the correct results, but nhibernate somehow doesnt create the complete list of objects.

Is this a bug??? Me that misunderstands or oversee something.

Regards,
Casper Skydt


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

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.