cfthread or cflock?
I've been using CF for a while but haven't had an opportunity to use cfthread (and have used cflock occassionally).
I have a page that does a number of resource intensive things, in the following order:
1) Runs a stored proc (let's call it SP 1) that selects everyone that will get an email
2) Writes the email info to a table and a bunch of related tables
3) Another SP that does a big insert in different tables
4) CFMail using the query attribute from step #1
The issue I'm running into is that if user a selects a "contact list" of say 5,000 records at 11:30 and then user b comes along and selects a list of 100 at 11:32, the email content from user a will go out to user b's list b/c it ran faster than the first process. Should I wrap the whole page in one giant cflock or is this a good scenario for cfthread? This seems like the classic "race condition" issue which is addressed by cflock but thought I'd ask.
Thanks for any insight.
