Immidate command during MySQL Transaction -


during sign process, i'm using transaction enclose operations involved in setup of account in event of problem can rolled back.

the last item occurs billing process if payment successful, commit operation called finalise account creation, if say, user's card declined, roll back.

however, wondering best way write log of attempted billing database without particular write operation being 'covered' transaction protecting other database operations. possible in mysql? log table in question not depend on others. holding on data in application write after rollback operation difficult due legacy payment libraries created before started using transactions. i'd avoid if mysql has solution.

i not use transactions goal in mind. operations describe seem have full right exist independently.

for example, invoice has header , 1 or more lines. use transaction ensure don't store incomplete invoice in database because application error: there's no circumstance in business logic have e.g. line without header.

however, having unconfirmed account makes perfect sense business logic point of view. customer prefer informed situation , able provide payment method rather start on again.

furthermore, using transaction such lengthy process requires keeping open connection mysql server. if ever need implement http interface you'll have rethink whole logic.

in short, transactions tool protect against application errors, not mechanism implement business logic.


Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -