Wednesday, 28 August 2013

Immidate command during MySQL Transaction

Immidate command during MySQL Transaction

During a sign up process, I'm using a Transaction to enclose all the
operations involved in the setup of an account so that in the event of a
problem they can be rolled back.
The last item that occurs is a billing process so that if payment is
successful, the Commit operation is called to finalise the account
creation, if say, the user's card is declined, I roll back.
However, I am wondering what the best way is to write a log of the
attempted billing to the database without that particular write operation
being 'covered' by the transaction protecting the other database
operations. Is this possible in MySQL? The log table in question does not
depend on any others. Holding on to the data in the application to write
it after the rollback operation is somewhat difficult due to legacy
payment libraries created before we started using transactions. I'd like
to avoid that if MySQL has a solution.

No comments:

Post a Comment