Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have to save large amount of data to database. From client I am making repeated AJAX calls to send data to server, as data is too big to send in single request. But I want to save data to database in single transaction. If all data is saved then only commit otherwise rollback. is it possible to save all data in single transaction across multiple AJAX http requests ?
Posted
Updated 4-Mar-10 1:56am
v2

Just a quick thought: perhaps have a transient table to store these items. When you are satisfied that they are all there then push them to the correct table in one go or delete them all and start again.
 
Share this answer
 
Thanks for the answer. It is a way to do that but I cannot use temparary table for storing data as I have to update 7 defferent tables to update. Please give me some alternate solution. Eagerly waiting for solution.
 
Share this answer
 
I didn't say temporary, I said transient: meaning the data is transient, not the table! (Perhaps I should have been clearer). Pump the data in (assigning each record a key that identifies the entire set - perhaps a guid created at the start of the process) and, once the process is ready (however you decide that) you can then run a stored proc (for instance) that will do whatever it is you do with that specific set of data leaving you free to sprinkle more data into the transient table.
 
Share this answer
 
Using ajax queue for multiple ajax requests will be a better solution. See the link

http://goo.gl/exo6M[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900