Print Thread
Session checkconnection(true)
#49235 07/18/14 07:30 AM
Joined: Sep 2000
Posts: 15
Milano, Italy
M
mclot Offline OP
Member
OP Offline
Member
M
Joined: Sep 2000
Posts: 15
Milano, Italy
Hi everybody,

I'm a little bit confused about the behaviour of "reconnect" parameter in CheckConnection function of DOA session component.
I don't understand when the reconnecting may occur.
I test my application connection periodically via a timer. If I disconnect the network cable, I correctly get the ccError from the CheckConnection function call. But when I reconnect the network cable, the CheckConnection still returns ccError, even if I've forced the reconnection with the reconnect parameter.
In other posts Marco wrote that you need to have a valid session connection in order to get working the CheckConnection function, and that's why I'm confused ... If you need a valid session connection, I expect to get back always OK or error and I don't understand WHEN the reconnecting step may occur.
The help file doesn't help as it states that the reconnect parameter is useful to re-establish the lost connection and that's what I expected to get. Or maybe it works only under specific circumstances and/or only when the connected property of the TSession component still results true?
May someone explain this behaviour?

TIA and best regards
Massimo

Re: Session checkconnection(true)
mclot #49239 07/18/14 09:20 AM
Joined: Aug 1999
Posts: 22,203
Member
Offline
Member
Joined: Aug 1999
Posts: 22,203
For a reconnect to work you need a valid network connection and the Oracle Server must be available.

I tested your scenario, and it seems to work fine. The CheckConnection function first returns ccOK when the network cable is connected, when disconnected it returns ccError, and after reconnecting it first returns ccReconnected, and subsequent calls return ccOK again.

What you might try is to debug this scenario, so that you can see exactly which Oracle Errors occur when the cable is disconnected, and subsequently when it is reconnected.


Marco Kalter
Allround Automations
Re: Session checkconnection(true)
Marco Kalter #49319 08/04/14 07:20 AM
Joined: Sep 2000
Posts: 15
Milano, Italy
M
mclot Offline OP
Member
OP Offline
Member
M
Joined: Sep 2000
Posts: 15
Milano, Italy
First of all, really sorry for the delay in my feedback ...
You're right! debugging, I discover a tricky statement in a procedure of mine that was changing in a wrong way the username property of the TOracleSession and obviously I received the Oracle msg "Invalid username/password" error.
After the bug fix, the checkconnection worked perfectly.
Thanks a lot.
Massimo


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.026s Queries: 15 (0.007s) Memory: 2.5044 MB (Peak: 3.0398 MB) Data Comp: Off Server Time: 2024-04-25 01:10:51 UTC
Valid HTML 5 and Valid CSS