> > I wouldn't consider this a long running task, but I would recommend > processing the subscribers in smaller batches. the scope of the > session/transaction can be the calling member. being this is a set based > operation maybe using stateless session and batched updates would also be > more appropriate.
Yes, use small batches as your example could potentially load a million subscribers in memory and process each one by one in the same transaction. I would have have a do..while loop that does the fetching of batches. Within that loop I would prepare each newsletter and send it to a message queue. Then let the message queue send each seperate prepared newsletter. You could also combine the preparing and sending in one handler. Its just the mechanism that counts. Also, you are not making any real use of the session cache so it is probably much more usefull to use a stateless session. -- Ramon -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
