> i have a complex transaction that i have grouped into 
> multiple includes. i am trying to wrap them into a transaction 
> so that if any part fails, i can rollback.
> 
> <cftransaction action="begin">
>    <cfinclude template="part1.cfm"> (if exception, rollback)
>    <cfinclude template="part2.cfm"> (if exception, rollback)
>    <cfinclude template="part3.cfm"> (if exception, rollback)
> </cftransaction>
> 
> however, if i have an error in part2, everything in part1 is still
> committed. AND, if i try to set <cftransaction action="rollback"/> 
> to any included file, it gives me an error saying that it's not 
> wrapped in a <cftransaction>.
> 
> am i to assume from this that i can't use <cftransaction> to group
> includes? seriously?

Your assumption is correct.

CFTRANSACTION tags must be contained within the same script. This isn't
listed within the documentation, as far as I can tell, but it is known by
Allaire (it's discussed within the Advanced CF Development class). This
behavior is intentional, and there's a pretty strong logical justification
underlying it - you want transactions to be as short and atomic as possible,
and you don't want to start a transaction with the possibility that you
won't declare an end to that transaction.

In any case, you're much better off migrating your transactional logic to
your database using stored procedures.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to