Last post Nov 10, 2010 06:00 PM by balloon
Nov 10, 2010 12:21 AM|A2H|LINK
I have an application which connect to oracle db.
I have two database hitting functions.
One is adding Userdetails(Fn Name : AddUserDtls) and another one adding address details(Fn name : AddAddresDtls) based on UserName which will get added after execution of first method ie AddUserDtls.
Problem I am facing is :
I have a single transaction and in that I have all the methods.
After the execution of first method,with out commiting i will go to second method.
and if any error occurs in second method.
I will rollback everything including the changes made by first method also.
Here one issue is there.
Since I am not committing the changes made by first method,
While I am executing the second method I am getting error that 'No user Name exists'
How to solve this issue.
I understood that if we commit the transaction before the second method starts ,it will solve the issue.
But then it creates another problem.If some problem araise in the second method,then I cannot rollback the changes made by first method since it aleready commited.
Please help me to solve the issue
Nov 10, 2010 06:00 PM|Balloon|LINK
The first and more simple way - you can use SavePoint in oracle. Cathing exception and rollingback to savePoint
Another way - use handle transaction on asp.net side. And after execution - set commit via this transaction.