Hey Mihai, (does that rhyme?) The AddCustomer() method actually creates
other CFCs and calls *their* Add()
methods - there is no actual SQL on that page. Plus, more than 1 DB is being
accessed to complete the transaction. The contact info is stored in a separate
DB from the Customer info. You can’t put 2 different DBs in 1 transaction can
you? Cheers, Baz From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mihai Manuta You should create a transaction at the begining of the insert code and
close it at the end.
Hi,
Lets say you have a method AddCustomer() that adds a customer into your DB. A customer, however, is related to several other CFCs and DB tables such as Addess, phone, email, etc. (each their own CFCs). So the AddCustomer() method looks something like this:
. InsertCustomer() . If error, exit . InsertPhone() . If error: DeleteCustomer(), exit . InsertEmail() . If error: DeletePhone(), DeleteCustomer(), exit . etc...
If this goes on for a few more Inserts, you could see the last "If error" having a lot of Deletes.
Is this a reasonable way of going about this? Anything I should?
Cheers, Baz
---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to cfcdev@cfczone.org with the words 'unsubscribe cfcdev' as the subject of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).
An archive of the CFCDev list is available at www.mail-archive.com/cfcdev@cfczone.org
---------------------------------------------------------- |
- Re: [CFCDev] ARF+Reactor - was SQL ... Kurt Wiersma
- Re: [CFCDev] ARF+Reactor - was SQL ... Matt Woodward
- RE: [CFCDev] ARF+Reactor - was SQL ... Phillip Senn
- Re: [CFCDev] ARF+Reactor - was SQL ... Peter J. Farrell
- Re: [CFCDev] ARF+Reactor - was SQL ... Tom Allen
- RE: [CFCDev] ARF+Reactor - was SQL ... Edward Chowdhury
- Re: [CFCDev] ARF+Reactor - was SQL ... Doug Hughes
- RE: [CFCDev] ARF+Reactor - was SQL ... Edward Chowdhury
- [CFCDev] Inserting multiple records... Baz
- Re: [CFCDev] Inserting multiple rec... Mihai Manuta
- RE: [CFCDev] Inserting multiple rec... Baz
- RE: [CFCDev] Inserting multiple rec... Mihai Manuta
- Re: [CFCDev] Inserting multiple rec... Jason Daiger
- Re: [CFCDev] Inserting multiple rec... Patrick Branley
- RE: [CFCDev] Inserting multiple rec... Baz
- RE: [CFCDev] SQL Scenario Nando