Could GetConnection method in TDBConnectionPool (unit XData.Aurelius.ConnectionPool) be made virtual in future versions?
I have my own ConnectionPool inherited from TDBConnectionPool that needs overriding GetConnection, to do so I have to keep a custom (modified) install of XData.
Regards,
wlandgraf
(Wagner Landgraf)
October 19, 2020, 1:31pm
2
You can simply redeclare GetConnection
in descendant class and reimplement the interface:
TMyConnectionPool = class(TDBConnectionPool, IDBConnectionPool)
function GetConnection: IDBConnection;
end;
This will simply call GetConnection from your class, not from the base class.
Hi Wagner, thanks for your feedback.
I tryed that before and did not work as intended (TDbConnectionPool gets called instead of TMyConnectionPool).
I'll check again.
wlandgraf
(Wagner Landgraf)
October 19, 2020, 2:18pm
4
You have to make sure that TMyConnectionPool
"reimplements" IDBConnection
interface. This will not work:
TMyConnectionPool = class(TDBConnectionPool)
You have to explicitly "implement" the interface (even though it's already implemented in ancestor):
TMyConnectionPool = class(TDBConnectionPool, IDBConnectionPool)
system
(system)
Closed
October 19, 2020, 9:03pm
6
This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.