ODAC 6.90.0.57-bcb 2010 - cannot catch ORA-03114 - 10.2.0.3
Posted: Thu 03 Nov 2011 09:34
Hi,
I have a business-critical application that has to run 24/24, 7/7, and that should be able to warn (and wait then retry) when db is down or network is down.
I would like to catch a connection failure, I am NOT using Direct mode.
Client is win vista 32 bits ultimate, oracle client 10.2.0.3.0.
Server is a free 10g xe on windows xp pro sp 3.
I have a global TOraSession, connection is ok at startup.
I have a Timer event that checks (when idle, every 30 seconds) that the connection is fine, using Ping() method. Even if Ping throws an exception, TOraSession's Connected property is still true.
=>When ping throws an exception, I would like to set the Connected property to false (as the Connected property is used to check connection at lots of places in the code).
However, as soon as I get a ORA-03114, the exception is shown... but is not catched!
To reproduce: put a TOraSession (named m_dbOurDB) on a form, with valid connection credentials, and set connected to true. Put a ttimer event (active every 30 seconds) and put this code in it:
Then
1. start the program.
2. remove network cable from server to trigger a network failure.
When timer triggers, the ORA-03114 happens and cannot be catched. Connected property cannot be set to false.
I have a business-critical application that has to run 24/24, 7/7, and that should be able to warn (and wait then retry) when db is down or network is down.
I would like to catch a connection failure, I am NOT using Direct mode.
Client is win vista 32 bits ultimate, oracle client 10.2.0.3.0.
Server is a free 10g xe on windows xp pro sp 3.
I have a global TOraSession, connection is ok at startup.
I have a Timer event that checks (when idle, every 30 seconds) that the connection is fine, using Ping() method. Even if Ping throws an exception, TOraSession's Connected property is still true.
=>When ping throws an exception, I would like to set the Connected property to false (as the Connected property is used to check connection at lots of places in the code).
However, as soon as I get a ORA-03114, the exception is shown... but is not catched!
To reproduce: put a TOraSession (named m_dbOurDB) on a form, with valid connection credentials, and set connected to true. Put a ttimer event (active every 30 seconds) and put this code in it:
Code: Select all
{
bool bCloseConnection=false;
try {
m_dbOurDB->Ping();
}
catch(...) { bCloseConnection=true; }
if (m_dbOurDB->Connected && bCloseConnection)
try {
m_dbOurDB->Close();
}
catch(...) {}
}
1. start the program.
2. remove network cable from server to trigger a network failure.
When timer triggers, the ORA-03114 happens and cannot be catched. Connected property cannot be set to false.