users@glassfish.java.net

RE: Additional properties in connection pools

From: Kevin Regan <k.regan_at_f5.com>
Date: Wed, 16 May 2012 18:25:55 +0000

I have been doing a bit of development work for Glassfish without an IDE (just make and Emacs). I’ve been compiling against the following JAR files:

[install_root]/glassfish/modules/javax.servlet-api.jar
[install_root]/glassfish/modules/jersey-core.jar

These are the Servlet API and Jersey API versions shipped with Glassfish. I figured it was best to compile against these JARs as I would be using only the version of Servlets and Jersey supported by my current Glassfish installation (v3.1.2).

--Kevin

From: Laird Nelson [mailto:ljnelson_at_gmail.com]
Sent: Wednesday, May 16, 2012 10:14 AM
To: users
Subject: Additional properties in connection pools

I'm untangling an Informix documentation error and trying to understand what the interaction is between the Additional Properties tab in a connection pool and the underlying DataSource implementation supplied by the vendor.

Informix has an utterly bizarre convention where you can set an "environment variable" in a JDBC URL. If you do this, then it is effectively applied at the server level. Nice.

However, if you specify one of these "environment variables" in the additional properties section of a connection pool, Glassfish throws a NullPointerException (well, it's probably the underlying Informix driver, I'd guess, atlhough there's not a stack trace to prove it).

Instead, if you prefix the environment variable name with "ifx", then the property goes through fine.

Interestingly, the Informix DataSource implementation has a bunch of getters and setters that start with, e.g., "setIfx". So you might have, for example, setIfxIFXHOST().

I'm guessing that the connection pool "additional properties" tab simply takes its property names and tries to call bean setters on the underlying data source implementation? Hence a property name of ifxIFXHOST and a value of "fred" would get routed to InformixDataSourceImplementation#setIfxIFXHOST("fred")?

(Otherwise I can't even begin to explain what's going on. :-))

Thanks,
Laird

--
http://about.me/lairdnelson