Can I roll back certain query(insert/update) execution in one page if query (insert/update) in other page execution fails in asp.net.( I am using sqlserver 2000 as back end)
scenario
In a webpage1, I have insert query into master table and Page2 I have insert query to store data in sub table.
I need to rollback the insert command execution for sub table ,if insert command to master table in web page1 is failed. (Query in webpage2 executes first, then only the query in webpage1) Can I use System. Transaction to solve this?
Thanks in advanceHi, sreejith
Yes, we can make the trasaction pass from one page to the other. However, a pending trasaction may lock the table for a long time.
In a multi-user environment, this would prevent the other users from reading/writing data. So, I suggest you let the user input data in both 2 pages. Then, after the second page is finished, call the 2 inserts together. This will make your application better.
HTH. If this does not answer you question, please feel free to mark it as Not Answered and post your reply. Thanks!
|||Can we keep a database connection open in one page, used in some other page .
wont it show error ?
can u provide some link or code samples for above mentioned transaction.
No comments:
Post a Comment