Labeling connections using Oracle Universal Connection Pool (UCP) doesn't seem to work

Posted by sapporo on Stack Overflow See other posts from Stack Overflow or by sapporo
Published on 2010-05-25T17:18:37Z Indexed on 2010/05/25 17:21 UTC
Read the original article Hit count: 539

Filed under:
|
|
|
|

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!

© Stack Overflow or respective owner

Related posts about java

Related posts about Oracle