Multimobile Development: Building Applications for any Smartphone
Connection recovery problem with OracleConnection
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.adonet.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Michael Bachar
Hi,

I'm using ADO.Net in C# with Oracle9i Release 9.2.0.4.0
when loosing the connection with the Oracle database server the connections
doesn't recover and always returning the following exception even when the
connection has been restore:
"ORA-03114: not connected to ORACLE". I'm closing the connection properly in
that it will return to the connection pool. Here is an example code:

using(OracleConnection conn = new OracleConnection(connectionString))
{
conn.Open();
using(OracleCommand cmd = new OracleCommand(sql, conn))
{
object obj = cmd.ExecuteScalar();
}
}

This should close the connection properly. In the MSDN it is mention that if
the connection pooler detect that the connection with the server has been
severed it will remove the connection from the connection pool. It appears
that this is not happening an I always get bad connections from the pool,
even after the connection with the database server has been restore. How can
I solve this? What is the proper way to recover from connection lost with
database server?

Thanks,
Michael.

Reply to this message...
Vote that this is a GOOD answer...
 
Really good experience at the Apple Store
MonoDroid – looking *awesome*
 
    
Manish Jadhav
Michael,

I am not sure about your question. Do you mind providing more details?
Are you saying that you can open a connection to the Oracle database sometimes, but not some other times? OR a successfully opened connection just throws this error when you try to use it later?

-Manish
Reply to this message...
Vote that this is a GOOD answer...
 
First volume of Multimobile Development nearly ready to go to press
A mention on Developing for the iPhone and Android: The pros and cons
 
    
Michael Bachar
Manish,

Here is a scenario:
I'm using ado.net to open connection with the database server. I use this
connection to perform an sql select statement, when finish I close the
connection properly. I repeat this process X times. While this is happening
the network connection with the database server is lost (the network cable
has been plugged out), after the network connection has been resorted, I
still get an error message: "ORA-03114: not connected to ORACLE".

In the MSDN it is mention that if the connection pooler detect that the
connection with the server has been severed it will remove the connection
from the connection pool. It appears that this is not happening an I always
get bad connections from the pool, even after the connection with the
database server has been restore

Michael.

"Manish Jadhav" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

just throws this error when you try to use it later?
[Original message clipped]

Reply to this message...
Vote that this is a GOOD answer...
 
 
    
Angel Saenz-Badillos[MS] (VIP)
Michael,
I am sorry this one is my fault and it is a very bad bug. The problem here
is that our pooler fails to understand that a 03114 exception means we
should not put the connection back in the pool. We have a QFE that fixes
this problem by discarding the connection in the following Oracle
exceptions. Please let me know if you know of any other exceptions that also
result in a connection no longer being valid.

oracle exceptions checked
case 18: // max sessions exceeded,
case 19: // max session licenses exceeded
case 24: // server is in single process mode
case 28: // session has been killed
case 436: // oracle isn't licensed
case 1012 //not logged on error
case 1033: // startup/shutdown in progress
case 1034: // oracle not available
case 1075: // currently logged on
case 3113: // end-of-file on communication channel
case 3114: // not connected to ORACLE
case 12154: // can't resolve service name
case 12xxx //any error starting with 12 thousand

To get the fix please contact PSS directly and request QFE 830173
--
Angel Saenz-Badillos [MS] Managed Providers
This posting is provided "AS IS", with no warranties, and confers no
rights.Please do not send email directly to this alias.
This alias is for newsgroup purposes only.

"Michael Bachar" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
Vote that this is a GOOD answer...
 
 
 
System.Data.OracleClient.OracleCommand
System.Data.OracleClient.OracleConnection




Ad
BootFX
Reliable and powerful .NET application framework.
iOS, Android and Windows Phone Development Training and Consultancy
Hosted by RackSRV Communications
 
Multimobile Development: Building Applications for any Smartphone
Copyright © AMX Software Ltd 2008-2010. Portions copyright © Matthew Baxter-Reynolds 2001-2010. All rights reserved.
Contact Us - Terms of Use - Privacy Policy - 4.0.30129.1734