> I have a set of db inserts involving two datasources > and if there is a failure in the 2nd datasource, I > need to roll back the transaction on the first datasource. > In a perfect world I could somehow hold up the first > transaction commit until the transaction on the second > datasource has completed successfully and then commit > them both. However I'm not sure how to do this with > cftransaction since it throws an error if multiple > datasources are used. Doing the transaction in just > SQL might be doable, but I would like to avoid that > if at all possible, because the amount of re-engineering > that would be necessary.
You won't be able to perform distributed transaction processing with CFTRANSACTION; as you've discovered, it only works with a single datasource, or more specifically, a single database connection I think. So, you won't be able to do what you're trying to do directly from CFML. If both datasources are hosted on the same database, you could potentially combine them within a single CFQUERY, and make that query act as a transaction. If the datasources are on different database servers, then I think you'll need to look into using some sort of distributed transaction coordinator. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ voice: (202) 797-5496 fax: (202) 797-5444 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

