The list of questions and answers related to TADManager and TADConnection.
A: You can only have one ADManager in a application. Instead of explicit creating that in your classes, refer a singleton object via ADManager function.
A: Do you really need the TADManager's ? An application does not need to explicitly create the TADManager. It is required to set the options and the configuration files in design time.
A: No, this cannot be fixed. Because only single TADManager may be created at design or run time. If there will be few TADManager's, then AnyDAC will not know which one to use. Also see QC1.
A: Yes, it has. In general, connection pooling keeps a pool of open "physical" connections, and when TADConnection.Connected is set to True, then AnyDAC takes a "physical" connection from the pool and uses it. When application is set TADConnection.Connected to False, the "physical" connection is not closed, but put back into pool.
To use connection pooling in AnyDAC, just add Pooled=True to you connection definition. No more special actions your application should take. Read Multi Threading for details.
A: You have to set VendorLib before first connection using this driver. After a connection is established, the DBMS client is loaded.
At design-time to make sure that your TADPhysXXXDriverLink properties are in the usage, check that TADPhysXXXDriverLink is first in the data module / form creation order. Then optionally restart Delphi IDE.
At run-time use the driver link Release method:
ADConnection1.Close; ... ADConnectionN.Close; ADPhysIBDriverLink.VendorLib := 'c:\fbclient.dll'; ADPhysIBDriverLink.Release; ADConnection1.Open; ... ADConnectionN.Open;
Other option is to define a virtual driver. Read the following for details Configuring Drivers. For example:
[FB_Embedded] BaseDriverID=IB VendorLib = C:\fb\fbembed.dll
And use FB_Embedded driver as a DriverID at design time. At run time you can also use ADDrivers.ini or just configure TADPhysXXXDriverLink.
|
What do you think about this topic? Send feedback!
|