G
Guest
All,
I have a C# application with an Oracle backend. There is a fair amount of
locking being used to prevent two users from update the same records. So we
use the Oracle FOR UPDATE NOWAIT in our SQL calls. This works fine and the
second user is not allowed to access the same record as the first user.
Currently we are using a try catch block to catch the Oracle exception
ORA-0054. Then we exit the subroutine.
I am trying to look for a way to see if I can resume the execution from the
failure point.
For example:
try
{
SQL call to DB using FOR UPDATE NOWAIT;
}
catch (System.Data.OracleClient.OracleException ex)
{
if (ex.Message.IndexOf("ORA-0054")!=0)
do something;
}
When I get the exception I would like to try again up to three times before
finally quitting.
Is there a way of saying RESUME (an equivalent in C#) as in VB.net. I
realize I may need a loop of some kind or counter to keep track of the number
of attempts. I would like the code to try to execute the SQL again rather
than just exiting the first time we hit ORA-0054.
Any help or suggestions are always appreciated.
Jawahar
I have a C# application with an Oracle backend. There is a fair amount of
locking being used to prevent two users from update the same records. So we
use the Oracle FOR UPDATE NOWAIT in our SQL calls. This works fine and the
second user is not allowed to access the same record as the first user.
Currently we are using a try catch block to catch the Oracle exception
ORA-0054. Then we exit the subroutine.
I am trying to look for a way to see if I can resume the execution from the
failure point.
For example:
try
{
SQL call to DB using FOR UPDATE NOWAIT;
}
catch (System.Data.OracleClient.OracleException ex)
{
if (ex.Message.IndexOf("ORA-0054")!=0)
do something;
}
When I get the exception I would like to try again up to three times before
finally quitting.
Is there a way of saying RESUME (an equivalent in C#) as in VB.net. I
realize I may need a loop of some kind or counter to keep track of the number
of attempts. I would like the code to try to execute the SQL again rather
than just exiting the first time we hit ORA-0054.
Any help or suggestions are always appreciated.
Jawahar