-->
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.  [ 3 posts ] 
Author Message
 Post subject: Large collection recommendations
PostPosted: Thu Oct 20, 2005 9:08 pm 
I have a letter object with a customers collection that is lazy loaded.

The letter object contains information about the letter ie template and formatting.

The problem is my email sender needs to iterate one record at a time through the rows sending an email to each customer. Filling the whole collection is not an option as there are literly millions of customers.

After each email is update sent for the customer a flag is set against the customer record which needs to be saved to the database.

What would be the best way to do this?

At present if i was not working with objects, i would open a data reader and walk through each record and send the email based on the columns in the datareader.

is there any support for walking through a large collection of rows in Nhibernate. I tried using methods on criteria objects setfirstrecord and setmaxresults but the sql generated under MS sql2000 dialect is very inefficient. IE it selects top <n> records to get the first record required by the index. Imagine running querys as you walk through the records like select top 1 from ...., select top 2 from ....., select top 3 ...., select top 4 ....

Any suggestions would be appreciated.


Top
  
 
 Post subject:
PostPosted: Thu Oct 20, 2005 10:01 pm 
Newbie

Joined: Thu Oct 20, 2005 5:17 pm
Posts: 19
If you're using SQL Server, then I don't think you'll be able to do it through NHibernate until SQL 2005. This post has a workaround that someone in a similar situation used.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 20, 2005 10:19 pm 
thanks. ill have a look at that


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