Problem with exceptions
Posted: Thu 04 Dec 2008 16:24
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.
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.