Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0-M3
-
None
-
None
Description
DriverManager will not connect to drivers that aren't in the classloader of the code that calls DriverManager. This makes use of tranql connector tricky in scenarios such as the following:
config 1 uses tranql connector, connects to some db.
config 2, child of config 1, uses tranql connector, tries to use a different driver. DriverManager reports it cannot find a suitable driver for the URL. The tranql connector class that is calling DriverManager is in a parent classloader of the driver.
possible solutions:
1) rearrange configurations so you never have tranql connector in your parent classloader.
2) write more tranql connector classes that use datasource and pooled datasource implementations
3) dynamically generate a class at runtime in the driver's classloader or a child classloader that calls DriverManager.
In order of desirability, I'd say 2, 1, 3, but I think we have to investigate (3) since this problem is just about impossible to diagnose.
Thanks to Dan Debrunner for pointing out this "feature" of DriverManager.