Hi,
I do open all tables at my Datamoduls OnCreate-event (close them at Ondestroy-event). If the application is idle for a while, an ORA-03135 raises. This mean that the connection has been lost to the server. Is there a property that need to be set in order to prevent a disconnect or should there be a reconnect-procedure somewhere and how will it be like (code wise)?
-Kurt
Prevent ORA-03135 from occure
To prevent error you can check connection before query execution. Connection check can be performed, for example, by calling Commit method of TOraSession. When connection is lost Commit method raises an exception.
If all datasets that use this session have FetchAll property set to True and there are no prepared datasets, ODAC will automatically reconnect to database when connection error occurs. Otherwise you can reconnect manually by calling Connect method of TOraSession.
If all datasets that use this session have FetchAll property set to True and there are no prepared datasets, ODAC will automatically reconnect to database when connection error occurs. Otherwise you can reconnect manually by calling Connect method of TOraSession.
Code: Select all
try
OraSession.Commit;
except
if not OraSession.Connected then
OraSession.Connect;
end;