Print Thread
Checking Connection to Database
#1307 11/25/00 05:02 PM
Joined: Nov 2000
Posts: 5
Santar
R
Ricardo Offline OP
Member
OP Offline
Member
R
Joined: Nov 2000
Posts: 5
Santar
Sometimes my OracleSession loses the connection to the database.

The CheckConnection method resolves parcially the problem.

I want to know if it is possible to generate an event in TOracleSession when a TOracleDataSet or a TOracleQuery is executed.
In that case I would write code in that event to check the connection.

I want to avoid writing code in all Datasets.

Thanks,
RF

Re: Checking Connection to Database
#1308 11/27/00 02:52 PM
Joined: Sep 1999
Posts: 27
Germany
K
Member
Offline
Member
K
Joined: Sep 1999
Posts: 27
Germany
You can derive your own version of TOracleQuery where you overrides the Execute method where you check and try to reconnect.

You onl yhave to replace all TOracleQuery instances in your project by your own Query object.

[quote]
Code
PROCEDURE TMyOraQuery.Execute;
BEGIN
  // check and try to reconnect
  IF Session.CheckConnection(TRUE)=ccError   
    // not connected
    THEN EXIT; (or raise exception, ...)
  INHRITED Execute;
END;
[/quote]

Oliver


Oliver Kaesmann

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.057s Queries: 13 (0.005s) Memory: 2.4995 MB (Peak: 3.0430 MB) Data Comp: Off Server Time: 2024-05-20 09:54:58 UTC
Valid HTML 5 and Valid CSS