As normally you would always use a connection pool (like BoneCP or c3p0), you can easily configure an InitSQL property to initialize your connection as needed.
Note that JDBC driver for now does not support search_path at all, as the OID cache lookup is not taking it into an account. So prepare for some crazy problems when for example returning a type that exists in several schemas with the same name.
With best regards,
-- Valentine
Hello Valentine,
I'll see if connection pools are available with BIRT (I'm using the integrated web viewer so I can't go around its limitations).
Thanks for the tip regarding the support for the search_path. Should I expect issues if the types that share a name across schemas have the same definition?
Regards,
Julien
Hello Julien,
You can always write a simple wrapper, that will override getConnection() and preinizialize there as needed.
The problem is now, that OID cache for types does not take into an account search_path at all. So if you have 2 types, that have the same name in 2 different schemas, one of them will be taken practically randomly, and if you do not have luck, it will take the wrong one and postgres will throw a crazy exception when the driver will try to use the wrong OID when passing this type as a parameter for example.