Cf Transaction Rollback On Error
Contents |
Transactions And Database Rollbacks That Involve 3rd Party API Integration By Ben Nadel on March 21, 2011 Tags: ColdFusion ColdFusion's CFTransaction tag is pretty awesome - you just wrap up a bunch of database interactions sql transaction rollback on error in the CFTransaction tag and any error thrown by any of the interactions automatically sql transaction rollback on error example rolls-back the entire set of database mutations. But, what if part of your database interaction workflow involves calling a 3rd party API?
Mysql Transaction Rollback On Error
In that case, you can't simply rely on the inherent behavior of the CFTransaction tag; rather, you have to perform both the local and remote cleanup yourself.This is exactly the type of situation that Ryan
T-sql Transaction Rollback On Error
Jeffords and I were dealing with last week. We had an application that created a user in our local database and then created a payment processing account and subscription plan in a remote payment gateway. The workflow was such that the local user record needed to be created before the remote payment account could be requested. The only problem was that the last step of the payment gateway integration could fail tsql transaction rollback on error if the supplied credit card was invalid. In such a case, we needed to rollback not only the local database but also the remote payment gateway.The linear processing looked a bit like this:LOCAL - Create user record.REMOTE - Create payment account.REMOTE - Create payment subscription (this could FAIL).If step #3 failed, we needed to roll back the remote mutations in step #2 and the local mutations in step #1.To do this, we needed to use more than just the CFTransaction tag; we needed to use a whole CFTransaction / CFTry / CFCatch / CFReThrow tag workflow. To demonstrate, I have set up a little simulation that involves both local and remote API calls:
error - Coldfusion Database Access Hi all, years ago on CF 4.5, our cftransaction tags used to rollback changed data when something inbetween