House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

cftransaction

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Chad Gray
11/01/2012 10:05 AM

Say I have code that is accesses multiple datasources.  CFTransaction cannot be used across multiple datasources. My question is can I make two CFTransaction blocks and on the first one set a CFTransaction SavePoint. Then if the second CFTransation errors can I roll back the first CFTransaction save point? Dummmy code: Cftransaction start Cftransaction set a save point1                 Do some queries on datasource 1 Cftransaction end Cftransaction start Cftry Cftransaction set save point2                 Do some queries on datasource 2 Cfcatch                 Cftransaction rollback save point 1                 Cftransaction rollback save point 2 Cftransaction end

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Watts
11/01/2012 10:48 AM

> Say I have code that is accesses multiple datasources.  CFTransaction cannot be used across multiple datasources. > > My question is can I make two CFTransaction blocks and on the first one set a CFTransaction SavePoint. > > Then if the second CFTransation errors can I roll back the first CFTransaction save point? No, I don't think you can do that. CF doesn't support distributed transactions. While CF 9 does allow nested transactions, they don't seem to let you do what you're trying to do here. What you could do - not that I'd recommend this - is have two transactions run essentially in parallel, have a wait/sleep loop in the first, and when the second one completes you could have it set a flag that can be read by the first one and then it could either commit or rollback. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our training centers, online, or onsite.


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 21, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference