Path: text.usenetserver.com!out04b.usenetserver.com!news.usenetserver.com!in04.usenetserver.com!news.usenetserver.com!nx01.iad01.newshosting.com!newshosting.com!post01.iad01!not-for-mail
Date: Fri, 09 Nov 2007 05:57:21 -0800
From: DA Morgan <damorgan@psoug.org>
Organization: Puget Sound Oracle Users Group
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
MIME-Version: 1.0
Newsgroups: comp.databases.oracle.tools
Subject: Re: How to simulate ORA-03114 "Not connected to Oracle" in a test
 application?
References: <47345e78$0$16669$9b4e6d93@newsspool3.arcor-online.net>
In-Reply-To: <47345e78$0$16669$9b4e6d93@newsspool3.arcor-online.net>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit
Message-ID: <1194616637.115847@bubbleator.drizzle.com>
Cache-Post-Path: bubbleator.drizzle.com!unknown@216.162.218.178
X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/)
Lines: 55
X-Complaints-To: abuse@csolutions.net
Xref: usenetserver.com comp.databases.oracle.tools:181768
X-Received-Date: Fri, 09 Nov 2007 08:57:18 EST (text.usenetserver.com)

André Hartmann wrote:
> 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
