We have problems catching an exception but perhaps i'm losing something, I'm newbie in Delphi development.
We are using "Oracle (Core Lab)" and "Delphi 2006".
The problem is in one of our customers; they have a firewall that "kills" all net connections after 10 minutes of inactivity. They ask us to look if we can handle this and reconect. Users left app open and when reestart to use an error ocurs, the firewal killed the net connection, the app crash and users have to reestart the app.
I thought to put a break point in delphi, kill the session in oracle, detect the error and reconnect to Oracle.
I have two problems:
1.- I can't trap the exception.
2.- My delphi didn't recognize the EOraError Exception.
I explain.
For the first point the code seems like this:
with Result do
try
SchemaName := strSchemeName;
StoredProcName := strStoredProcName; => Here we put the break point and kill the session
except
On e : Exception do => I try with EDataBaseError too
begin
raise Exception.Create(e.Message);
end;
end;
Result is TSQLStoredProc
The Oracle Error arrive to Delphi (EOraError with message 'ORA - 00028 your session has been killed'); but the exception doesn't fire, the code continues after try-except.
The second error perhaps is more stupid, if in this try-except block I put the EOraError Delphi doesn't recognize the word, I put the uses OraError and Delphi doesn't recognize too.
u need more info??
Thanks in advance.
Problem with exceptions
EOraError is the internal driver exception. It is raised and then catched inside the driver. So there is nothing to catch for you.
dbExpress does not raise an exception for user when an error occurs on setting the StoredProcName property. It just does not create parameters for a stored procedure.
You can catch an exception on the ExecProc method if the session is killed before the call of this method.
dbExpress does not raise an exception for user when an error occurs on setting the StoredProcName property. It just does not create parameters for a stored procedure.
You can catch an exception on the ExecProc method if the session is killed before the call of this method.
Re: Problem with exceptions
Hi,
I have the same problem in C++ Builder XE2.
The component dbExpress driver for Oracle 6.1.2 reconnect automatically after receive 'ORA-00028 your session has been killed'.
I need to catch that error to decide to terminate my application or not. How can I do it?
Thank you,
Reinaldo Guedes
Brazil
I have the same problem in C++ Builder XE2.
The component dbExpress driver for Oracle 6.1.2 reconnect automatically after receive 'ORA-00028 your session has been killed'.
I need to catch that error to decide to terminate my application or not. How can I do it?
Thank you,
Reinaldo Guedes
Brazil
Re: Problem with exceptions
Hello,
To disable auto-reconnecting to the server, you should set the Reconnect parameter to False
SQLConnection1.Params.Values['Reconnect'] := 'False';
To disable auto-reconnecting to the server, you should set the Reconnect parameter to False
SQLConnection1.Params.Values['Reconnect'] := 'False';