473,326 Members | 2,337 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How to resume after an Oracle Error ORA-00054

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
Nov 16 '05 #1
1 7124
Jawahar,

There is no ay to do this (with a resume, that is). You will have to
execute in a loop, like you said. Basically, have a counter that counts
down from the number of times you want to try, as well as a flag (bool) that
indicates whether or not the operation completed. Then, cycle through the
loop while the operation was not completed, and the counter is greater than
zero.

It should be pointed out that locking rows like this will kill
scalability, and this kind of "retry" semantics will become very unwieldy
and difficult to maintain.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jawahar" <Ja*****@discussions.microsoft.com> wrote in message
news:D6**********************************@microsof t.com...
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

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: susmita_ganguly | last post by:
Hi I am trying to upgrade from oracle 8i to oracle 9i on the same server ..I don't know much abt migration . Can anyone help me out. Thanks. Susmita
2
by: Cherrish Vaidiyan | last post by:
Hello all, A warm Xmas greetings to all. I have a small problem with starting up the database. Here my strategy. I have installed Oracle 9i R 2 on Red Hat 9. i created two database on this...
1
by: Wayne Happ | last post by:
I'm a new Oracle user. I've installed Oracle 9i on a Linux RedHat machine V9.0 and it's running. I took a Windows XP machine and installed the Oracle client on it along with PL/SQL developer...
3
by: Jake McDermott | last post by:
We have a few developers that use Oracle 9i (9.2.0.4.0) on their personal workstations for testing purposes. Recently, weve made the decision to upgrade them to WinXP so that they are able to use...
4
by: Tig | last post by:
Hi all. I have a need to connect to an Oracle 7.3.3.5 database. I have a user who successfully connects to it with her Oracle 7.3 client. I have an Oracle 9.2 client installed on my machine....
4
by: Roger Redford | last post by:
Dear Experts, I'm attempting to marry a system to an Oracle 817 datbase. Oracle is my specialty, the back end mainly, so I don't know much about java or javascript. The system uses javascript...
13
by: Chris Botha | last post by:
The machine is running XP Pro with all the latest service packs, etc. I must access an Oracle database so I installed the Oracle client stuff. I can query Oracle from a Windows app, no problem....
5
by: Michael Rudolph | last post by:
Hi newsgroup, I have an issue with the configuration of a DB2 federated database (WebSphere Information Integrator) in conjunction with the relational wrapper for Oracle on AIX. DB2 seems to not...
5
by: Martin Solveig | last post by:
Hello, SLES9 SP1 is on PIII with two 800MHz procesors and 2GB RAM, on four SATA 156GBhard disks are created two RAID1 arays, on one RAID is OS with 1GB swap and Oracle 10.1.0.4 enterprise edition,...
2
by: devas | last post by:
Hai, Issue: I am using OEM 10g grid control. I want to establish the connection from oracle to sql server=>I can’t able to connect it. Please help me I have created the system dsn below steps....
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.