I do believe that your "middle" get_last_id query will be unnecessary - at least with MSSQL, when you save a brand new record, the new ID of that record is populated back into the object for immediate use.
 
Marc


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dan Sorensen
Sent: Thursday, August 10, 2006 7:09 PM
To: [email protected]
Subject: [Reactor for CF] Does Reactor have some type of cftransaction method?

Is a cftransaction type of commit/rollback possible with Reactor?

 

I have two records to insert in sequence. I’d like to validate both of them and only commit them together. The catch is that the 2nd record depends on getting the last_insert_id from the first record created during the 1st record.save() step. Normally I’d have 3 queries (insert 1, get_last_id, insert 2) setup within a cftransaction.

 

I’m sure this is a common issue, what’s the best practice? Any feedback on this topic would be great.

Thanks in advance!

Dan

 

P.S. This is more of a concept question, so I’m leaving code out, but let me know if code would be helpful.

 


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[email protected]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to