Labeling connections using Oracle Universal Connection Pool (UCP) doesn't seem to work
- by sapporo
I'm evaluating the Oracle Universal Connection Pool (UCP) included with their 11.2 JDBC driver, but cannot get the labeling functionality to work properly (which I'd like to use to minimize the amount of ALTER SESSION statements).
I'm basically following their sample code to implement the ConnectionLabelingCallback interface. The callback method cost(Properties reqLabels, Properties currentLabels) is called as expected, so the callback seems to be configured correctly.
However, the other callback method configure(Properties reqLabels, Object conn) is passed arguments that make it impossible to provide a meaningful implementation:
reqLabels is always null, so the callback method has no way of knowing what labels need to be set.
conn is of type oracle.jdbc.driver.T4CConnection, which cannot be cast to LabelableConnection, so the callback method has no way of inspecting or manipulating the labels attached to the connection.
My code is running on Java 6 and using ojdbc6.jar and ucp.jar version 11.2.0.1.0. The database is actually 10.2, but that should not be a problem according to the docs, since the UCP functionality is completely implemented in the JDBC driver.
Thanks in advance!