I understand that...  (ew, 15 saves on one page call?  Yuck... been there!)


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of João Fernandes
Sent: Friday, August 11, 2006 3:49 AM
To: [email protected]
Subject: Re: [Reactor for CF] Does Reactor have some type of cftransaction method?

Marc,You are right, I think any db supported by reactor does retrieve the id directly (I THINK) .

but you may want to surround the code by cftransaction so you could rollback in case something went wrong in your 15th save.

João Fernandes

On 8/11/06, Marc Funaro <[EMAIL PROTECTED]> wrote:
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/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
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