Hi,

Well... for the part with no SQL on the page I can certainly say there is no problem.
It does not matter where you have the SQL code.
The transaction wraps around all SQL executed from were it begins until it ends.

However, for the multiple databases... it does not work like you want it. In theory it would be possible because the cftransaction is not "exactly" an SQL transaction.
If the implementation of the <cftransaction> would create an SQL transaction in each database and it would commits both transactions only at the end of the tag, then it would be possible to roll them both back if an error occurs in the code.
Unfortunately, this is not they way it works... according to http://livedocs.macromedia.com/coldfusion/7/htmldocs/00000346.htm "Within a transaction block, you can write queries to more than one database, but you must commit or roll back a transaction to one database before writing a query to another." which is not very convenient...

Best regards,
Mihai

On Fri, 2006-02-03 at 06:51 -0500, Baz wrote:
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

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] 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/[email protected]

Reply via email to