Additional
AnyDAC
SimpleIAX
Forums
Welcome, Guest
Please Login or Register to post messages. Lost Password?
tadconnection and drivername AFTER reconnection
(1 viewing) 1 Guest
Go to bottom
TOPIC: tadconnection and drivername AFTER reconnection
#21373
lorife
Platinum Boarder
Posts: 354
graphgraph
Karma: 1
User Offline Click here to see the profile of this user
tadconnection and drivername AFTER reconnection 2012/06/26 01:41 (10 Months, 3 Weeks ago)
Hi,
I have a tadconnection set with the option to autoreconnect.

If server is up and i do:

AdConnection.Connected := True;
Then AdConnection.DriverName is correct (MySQL).

But, if server is down AdConnection will try 3 times to reconnect. Let's say that the first 2 times it cannot connect but at the third try it will then

AdConnection.DriverName will be equal to ''.

Is it a bug?

Thanks,
Lorenzo
Logged Logged
The administrator has disabled public write access.
#21382
Support
Moderator
Posts: 5635
graph
Karma: 99
User Offline Click here to see the profile of this user
Re:tadconnection and drivername AFTER reconnection 2012/06/26 05:40 (10 Months, 3 Weeks ago)
Hello

If you are using a persistent connection definition (ConnectionDefName specified), then DriverName will return a value only when the connection is active. Otherwise it will be empty.

So, if AnyDAC failed to recover the connection, then it will be closed. After that DriverName will be empty.
With best regards,
DA-SOFT Technologies Support Team
Logged Logged
The administrator has disabled public write access.
#21384
lorife
Platinum Boarder
Posts: 354
graphgraph
Karma: 1
User Offline Click here to see the profile of this user
Re:tadconnection and drivername AFTER reconnection 2012/06/26 05:45 (10 Months, 3 Weeks ago)
Hi,

But the problem is that if it fails the 1st time, and the 2nd connects then drivername will still be ''...
Logged Logged
The administrator has disabled public write access.
#21385
Support
Moderator
Posts: 5635
graph
Karma: 99
User Offline Click here to see the profile of this user
Re:tadconnection and drivername AFTER reconnection 2012/06/26 06:41 (10 Months, 3 Weeks ago)
Ok, fixed. To apply the fix:
- open uADCompClient
- locate there TADCustomConnection.ReleaseConnectionIntf method
- and the line in this method:
Code:

  lMain := AConnIntf = FConnectionIntf;

- then replace the line with
Code:

  lMain := @AConnIntf = @FConnectionIntf;


Please let me know how it works.
With best regards,
DA-SOFT Technologies Support Team
Logged Logged
The administrator has disabled public write access.
#21387
lorife
Platinum Boarder
Posts: 354
graphgraph
Karma: 1
User Offline Click here to see the profile of this user
Re:tadconnection and drivername AFTER reconnection 2012/06/26 06:59 (10 Months, 3 Weeks ago)
It works!

thank you again for your great support.

Lorenzo
Logged Logged
The administrator has disabled public write access.
Go to top