My Scenario:
My Web Page send two AJAX
Calls. Second AJAX
call is sent as a callback for the first AJAX
call in its success
function.
1) In First AJAX
call, I am updating certain contents in a table of a particular user.
2) In Second AJAX
call, I am updating certain contents of some other table of the same user.
My Concern:
Now for some reason if the Second AJAX
call fails (internet issues or something else), I want to make sure that the contents updated during the first AJAX
request is rolled back.
I thought Persistent Mysql Connection may be one solution to this problem, but have few queries:
1) Does this persistent connection belong to that client which initiated or all the requests to Mysql uses the same persistent connection?
2) Is there any better solution for this problem?
UPDATE:
I have two AJAX
Calls since I am sending a large base64 encoded image
in one of the AJAX
Calls, and it takes a huge amount of time sending other datas along with the image