dbTalk Databases Forums  

How to simulate ORA-03114 "Not connected to Oracle" in a test application?

comp.databases.oracle.tools comp.databases.oracle.tools


Discuss How to simulate ORA-03114 "Not connected to Oracle" in a test application? in the comp.databases.oracle.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
André Hartmann
 
Posts: n/a

Default How to simulate ORA-03114 "Not connected to Oracle" in a test application? - 11-09-2007 , 07:19 AM






Hi there,
I would like to simulate ORA-03114 in a test application and I would like to get some clues as to how to do this.

Since people are probably going to ask why I want to do that, here is some background. An Oracle client application of ours that
connects to Oracle via OCI, sometimes faces loss of connection, for example when a lap to goes into hibernation or the network is
unstable. We are speaking of a Windows 2000, XP, Vista client here. Now we want to improve the error handling in our application in
this specific case. That is no problem because ORA-03114 can be detected and appropriate measures can be taken (error message,
automatic reconnection, ...).

However for every issue that we fix in our applications we are writing a test case which will test a particular behaviour or bug
fix. We do this in form of unit tests, so the unit test application will simply run for a short or long span of time without user
interaction and protocol what happened, for example how many of the tests succeeded and how many failed.

The loss of connection we dont know how to simulate. One way is to use OEM and manually KILL the session at the appropriate point
of time and see what the application will do. But that requires user interaction, so its not like you can run the tests over night
and just scan the protocol the next morning...

We are using MS Dev studio 2005/2003 and the standard OCI library. Thanks very much in advance

André



Reply With Quote
  #2  
Old   
DA Morgan
 
Posts: n/a

Default Re: How to simulate ORA-03114 "Not connected to Oracle" in a testapplication? - 11-09-2007 , 07:57 AM






André Hartmann wrote:
Quote:
Hi there,
I would like to simulate ORA-03114 in a test application and I would
like to get some clues as to how to do this.

Since people are probably going to ask why I want to do that, here is
some background. An Oracle client application of ours that connects to
Oracle via OCI, sometimes faces loss of connection, for example when a
lap to goes into hibernation or the network is unstable. We are speaking
of a Windows 2000, XP, Vista client here. Now we want to improve the
error handling in our application in this specific case. That is no
problem because ORA-03114 can be detected and appropriate measures can
be taken (error message, automatic reconnection, ...).

However for every issue that we fix in our applications we are writing
a test case which will test a particular behaviour or bug fix. We do
this in form of unit tests, so the unit test application will simply run
for a short or long span of time without user interaction and protocol
what happened, for example how many of the tests succeeded and how many
failed.

The loss of connection we dont know how to simulate. One way is to use
OEM and manually KILL the session at the appropriate point of time and
see what the application will do. But that requires user interaction, so
its not like you can run the tests over night and just scan the protocol
the next morning...

We are using MS Dev studio 2005/2003 and the standard OCI library.
Thanks very much in advance

André

Some Oracle error messages for example, ORA-03114 not connected to
ORACLE, are not root causes but rather the result of something else.
A session might be disconnected for hundreds of reasons.

Trapping for a lack of connection will tell you nothing about why or
how you got there. For that you need to use:
DBMS.UTILITY.FORMAT_ERROR_BACKTRACE
DBMS.UTILITY.FORMAT_CALL_STACK
DBMS.UTILITY.FORMAT_ERROR_STACK

Demos in Morgan's Library at www.psoug.org under DBMS_UTILITY.

If all you want to do is create a disconnection pull the CAT5 cable
out of the back of a machine or use ALTER SYSTEM KILL SESSION:
Demostrated in the Library under KILLING SESSIONS.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #3  
Old   
André Hartmann
 
Posts: n/a

Default Re: How to simulate ORA-03114 "Not connected to Oracle" in a test application? - 11-09-2007 , 08:04 AM



"DA Morgan" <damorgan (AT) psoug (DOT) org> schrieb im Newsbeitrag news:1194616637.115847 (AT) bubbleator (DOT) drizzle.com...
Quote:
Some Oracle error messages for example, ORA-03114 not connected to ORACLE, are not root causes but rather the result of something
else.
A session might be disconnected for hundreds of reasons.

Yes, I know that. I am not aiming at tracking down the reason here, I am aiming at testing the application code, that reacts to the
occurrence of the event. For example the reaction could be to establish a new connection to the schema and continue as normal.



Reply With Quote
  #4  
Old   
Brian Tkatch
 
Posts: n/a

Default Re: How to simulate ORA-03114 "Not connected to Oracle" in a test application? - 11-09-2007 , 08:12 AM



On Fri, 9 Nov 2007 14:19:51 +0100, André Hartmann
<andre.hartmann (AT) hotmail (DOT) de> wrote:

Quote:
Hi there,
I would like to simulate ORA-03114 in a test application and I would like to get some clues as to how to do this.
According to the documentation:

ORA-03114 not connected to ORACLE

Cause: A call to Oracle was attempted when no connection was
established. Usually this happens because a user-written program has
not logged on. It may happen if communication trouble causes a
disconnection. In addition, this message could occur when ALTER SYSTEM
KILL SESSION or ALTER SYSTEM DISCONNECT SESSION were issued with the
IMMEDIATE qualifier because, in those cases, the client's connection
to the database is terminated without waiting for the client to issue
a request.

Action: Try again. If the message recurs and the program is user
written, check the program.

B.




Quote:
Since people are probably going to ask why I want to do that, here is some background. An Oracle client application of ours that
connects to Oracle via OCI, sometimes faces loss of connection, for example when a lap to goes into hibernation or the network is
unstable. We are speaking of a Windows 2000, XP, Vista client here. Now we want to improve the error handling in our application in
this specific case. That is no problem because ORA-03114 can be detected and appropriate measures can be taken (error message,
automatic reconnection, ...).

However for every issue that we fix in our applications we are writing a test case which will test a particular behaviour or bug
fix. We do this in form of unit tests, so the unit test application will simply run for a short or long span of time without user
interaction and protocol what happened, for example how many of the tests succeeded and how many failed.

The loss of connection we dont know how to simulate. One way is to use OEM and manually KILL the session at the appropriate point
of time and see what the application will do. But that requires user interaction, so its not like you can run the tests over night
and just scan the protocol the next morning...

We are using MS Dev studio 2005/2003 and the standard OCI library. Thanks very much in advance

André


Reply With Quote
  #5  
Old   
DA Morgan
 
Posts: n/a

Default Re: How to simulate ORA-03114 "Not connected to Oracle" in a testapplication? - 11-09-2007 , 08:25 AM



André Hartmann wrote:
Quote:
"DA Morgan" <damorgan (AT) psoug (DOT) org> schrieb im Newsbeitrag
news:1194616637.115847 (AT) bubbleator (DOT) drizzle.com...
Some Oracle error messages for example, ORA-03114 not connected to
ORACLE, are not root causes but rather the result of something else.
A session might be disconnected for hundreds of reasons.


Yes, I know that. I am not aiming at tracking down the reason here, I am
aiming at testing the application code, that reacts to the occurrence of
the event. For example the reaction could be to establish a new
connection to the schema and continue as normal.
But the application code is meaningless for this error message. Is the
cause of the disconnect that the Oracle client had a brain hemmorhage?
Or that the CAT5 cable is disconnected? Or the fact that someone on the
server did SHUTDOWN ABORT? You don't know. You can not know. And there
is nothing your application can do about it except keep trying to
reconnect for some finite period before timing out.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #6  
Old   
Paul
 
Posts: n/a

Default Re: How to simulate ORA-03114 "Not connected to Oracle" in a test application? - 11-09-2007 , 11:45 AM




"André Hartmann" <andre.hartmann (AT) hotmail (DOT) de> wrote

Quote:
Hi there,
I would like to simulate ORA-03114 in a test application and I would like
to get some clues as to how to do this.

Since people are probably going to ask why I want to do that, here is
some background. An Oracle client application of ours that connects to
Oracle via OCI, sometimes faces loss of connection, for example when a lap
to goes into hibernation or the network is unstable. We are speaking of a
Windows 2000, XP, Vista client here. Now we want to improve the error
handling in our application in this specific case. That is no problem
because ORA-03114 can be detected and appropriate measures can be taken
(error message, automatic reconnection, ...).

However for every issue that we fix in our applications we are writing a
test case which will test a particular behaviour or bug fix. We do this in
form of unit tests, so the unit test application will simply run for a
short or long span of time without user interaction and protocol what
happened, for example how many of the tests succeeded and how many failed.

The loss of connection we dont know how to simulate. One way is to use
OEM and manually KILL the session at the appropriate point of time and see
what the application will do. But that requires user interaction, so its
not like you can run the tests over night and just scan the protocol the
next morning...

We are using MS Dev studio 2005/2003 and the standard OCI library. Thanks
very much in advance

André

Raise application error , kill




Reply With Quote
  #7  
Old   
Frank van Bortel
 
Posts: n/a

Default Re: How to simulate ORA-03114 "Not connected to Oracle" in a testapplication? - 11-09-2007 , 12:30 PM



André Hartmann wrote:

Quote:
We are using MS Dev studio 2005/2003 and the standard OCI library.
Not familiar with these, but in SQL*Plus, you can issue
a "disconnect". It's the (seldom used) counterpart of
"connect <user>[/password][@tns_alias]"

--
Regards,
Frank van Bortel

Top-posting is one way to shut me up...


Reply With Quote
  #8  
Old   
Brian Tkatch
 
Posts: n/a

Default Re: How to simulate ORA-03114 "Not connected to Oracle" in a test application? - 11-09-2007 , 12:50 PM



On Fri, 9 Nov 2007 12:45:34 -0500, "Paul" <paulq_1998 (AT) yahoo (DOT) com>
wrote:

Quote:
"André Hartmann" <andre.hartmann (AT) hotmail (DOT) de> wrote in message
news:47345e78$0$16669$9b4e6d93 (AT) newsspool3 (DOT) arcor-online.net...
Hi there,
I would like to simulate ORA-03114 in a test application and I would like
to get some clues as to how to do this.

Since people are probably going to ask why I want to do that, here is
some background. An Oracle client application of ours that connects to
Oracle via OCI, sometimes faces loss of connection, for example when a lap
to goes into hibernation or the network is unstable. We are speaking of a
Windows 2000, XP, Vista client here. Now we want to improve the error
handling in our application in this specific case. That is no problem
because ORA-03114 can be detected and appropriate measures can be taken
(error message, automatic reconnection, ...).

However for every issue that we fix in our applications we are writing a
test case which will test a particular behaviour or bug fix. We do this in
form of unit tests, so the unit test application will simply run for a
short or long span of time without user interaction and protocol what
happened, for example how many of the tests succeeded and how many failed.

The loss of connection we dont know how to simulate. One way is to use
OEM and manually KILL the session at the appropriate point of time and see
what the application will do. But that requires user interaction, so its
not like you can run the tests over night and just scan the protocol the
next morning...

We are using MS Dev studio 2005/2003 and the standard OCI library. Thanks
very much in advance

André


Raise application error , kill

You cannot raise that error.

B.


Reply With Quote
  #9  
Old   
DA Morgan
 
Posts: n/a

Default Re: How to simulate ORA-03114 "Not connected to Oracle" in a testapplication? - 11-09-2007 , 01:49 PM



Brian Tkatch wrote:

Quote:
Raise application error , kill


You cannot raise that error.

B.
Actually you can using ORADEBUG but you would need to get Oracle support
to tell how.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #10  
Old   
Brian Tkatch
 
Posts: n/a

Default Re: How to simulate ORA-03114 "Not connected to Oracle" in a test application? - 11-12-2007 , 08:27 AM



On Fri, 09 Nov 2007 11:49:21 -0800, DA Morgan <damorgan (AT) psoug (DOT) org>
wrote:

Quote:
Brian Tkatch wrote:

Raise application error , kill


You cannot raise that error.

B.

Actually you can using ORADEBUG but you would need to get Oracle support
to tell how.
Interesting.

B.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.