|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
cftransaction
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 > 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.
|
May 21, 2013
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||