473,657 Members | 2,680 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Or acleClient.Orac leException ex)
{

if (ex.Message.Ind exOf("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 7156
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.co m

"Jawahar" <Ja*****@discus sions.microsoft .com> wrote in message
news:D6******** *************** ***********@mic rosoft.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.Or acleClient.Orac leException ex)
{

if (ex.Message.Ind exOf("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
19986
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
9171
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 system. And the two datasbe is working perfectly. Now i needed another RH9 system to work on Oracle 9i. So I was guided to copy the oracle home folder and that the oracle will be up for work. I even got such a response from Google Group. I copied...
1
7068
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 from All-Around-Software. I try to connect and I get an error message ORA-12545 "Connect failed because target host or object does not exist".
3
5230
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 some other functionalities of the OS, but we are running into a totally odd problem with Oracle. It seems that, Installing Oracle runs just fine, and our ant scripts to build the database work well...but when we reboot the computer, the database...
4
16828
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. I had her send me her tnsnames.ora from her PC. The entry I wanted was as follows (some letters replaced with xxx for security reasons):
4
7228
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 to make ODBC calls to the db. The particular system I'm working with, will not work with an Oracle stored procedure I'm told. However, it
13
7466
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. Using the exact same code (copy and paste) into a Web app I get the following error "Error while trying to retrieve text for error ORA-01019". Security I thought, so I use Impersonation on the Web site, then the aspnet_wp.exe crashes with "The...
5
5388
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 use the existing tnsnames.ora. The Oracle client is installed and the connection to the Oracle database using tnsping and sqlplus is possible (for the db2instance user). For that I changed the environment for the db2instanceuser and added the...
5
4152
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, on second RAID are two raw partitions each 70GB .... I start DBCA custom database and configure one ASM disk group by using two raw partitions (/dev/sdb1, /dev/sdb2),then I add 4 new tablespaces with datafiles of 2GB each autoextend on 10MB,...
2
5534
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. Step 1) Open the odbc data source administrator Step 2) select the system dsn tab page. And gave the dsnname Step 3) configure the server and tested the connection Step 4) connection has COMPLETED SUCCESSFULLY!
0
8407
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8739
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8612
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7347
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5638
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4171
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1732
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.