there is still a connection
there is still a connection
when I don`t use the programm for a long time the session on server is broken and when I`m trying to access the session it could call the event like "TDataModule1.OraSes1ConnectionLost".
I need to close the programm and for closing it I do this:
OraSes1.Rollback;
OraSes1.Disconnect;
Sometimes these calles TDataModule1.OraSes1ConnectionLost and as a consequence the reconnection. Reconnection takes lots of time.
Is any quick way to find out about the session activity and avoid the reconnection in closing of session?
I need to close the programm and for closing it I do this:
OraSes1.Rollback;
OraSes1.Disconnect;
Sometimes these calles TDataModule1.OraSes1ConnectionLost and as a consequence the reconnection. Reconnection takes lots of time.
Is any quick way to find out about the session activity and avoid the reconnection in closing of session?
Re: there is still a connection
Hello,
To check the current session, you can use the TOraSession.Ping method, having wrapped it into a Try...Except block, and, in case if execution of this method raises an error, execute the needed code in the except block. This method won't call the OnConnectionLost event independently on connection settings.
To check the current session, you can use the TOraSession.Ping method, having wrapped it into a Try...Except block, and, in case if execution of this method raises an error, execute the needed code in the except block. This method won't call the OnConnectionLost event independently on connection settings.
Re: there is still a connection
Method "Ping" the fastest?
Re: there is still a connection
Hello,
Yes, it is the easiest way to define server availability and avoid the OnConnectionLost event
Yes, it is the easiest way to define server availability and avoid the OnConnectionLost event
Re: there is still a connection
If user doesn`t use the program for a long time, he will get the message from the server that the connection is lost.
We get out from this situation using a timer and every minute send select * from dual to the session on the server didn`t close and still has been up to date.
May be a command Ping will do the same, but would it be faster and less overload the server?
We get out from this situation using a timer and every minute send select * from dual to the session on the server didn`t close and still has been up to date.
May be a command Ping will do the same, but would it be faster and less overload the server?
Re: there is still a connection
Hello,
Independently on how you execute the query (Open or Execute), server generates and returns ResultSet even for a query "SELECT * FROM DUAL", that requires definite time, the Ping command doesn't return ResultSet, therefore it is executed faster.
Independently on how you execute the query (Open or Execute), server generates and returns ResultSet even for a query "SELECT * FROM DUAL", that requires definite time, the Ping command doesn't return ResultSet, therefore it is executed faster.
Re: there is still a connection
Would the ping command keep the session in active state on the server?
Re: there is still a connection
Hello,
Yes, running the Ping command keeps the session in active.
Yes, running the Ping command keeps the session in active.