Tested with 3 versions including the latest one.
example:
public override bool IsOpen()
{
bool bPing = false;
try {
bPing = ( (OracleConnection)this.conn ).Ping();
}
catch {
bPing = false;
}
return bPing;
// return ( this.conn.State == ConnectionState.Open );
}
I expect that after a round trip to the database with exception such as ORA-12537 connection closed the state change to ConnectionState.Closed or ConnectionState.Brocken. As for example in odp or ado implemented.
In Your solution it plays no role: is this adirect or indirect connection, the state is Open.
Please fix this
Addition:
Trace of Your Ping():
-----------------------------------------------
Timestamp: 18.08.2011 14:03:10
begin null; end;
Elapsed time: 0.001
--------------------------------------------------------------------------------
Timestamp: 18.08.2011 14:03:11
begin null; end;
Elapsed time: 0.001
---------------------------------------------------
So let's calculate
0.001 seconds for each round trip.
if we need to send Ping() before, we say, 1.000.000 calls to the database
we get 1.000.000 x 0.001 = 1000 sec.
1000 seconds = 16,(6) minutes of time that we lose.
than we say that needed select, update,insert or delete use 0.006 sec
so
1.000.000 x 0.006 = 6000 sec = 100 minutes
so we need additional 16,(6) % of time to execute.
It's NO GO
Wrong implementation of IDbConnection.State
-
- Posts: 3
- Joined: Fri 08 Oct 2010 09:39
We have reproduced the behaviour when the ConnectionState.Open is not changed to Closed or Broken when OracleConnection.Ping() returns false. We will investigate the issue and notify you about the results as soon as possible. And we have asked you by e-mail for an additional information about the situation when OracleConnection.Ping() raises an exception.
-
- Posts: 3
- Joined: Fri 08 Oct 2010 09:39