java - Oracle UCP and NullPointerException -
i trying integrate oracle universal connection pool (ucp) tomcat6. server configuration following:
server.xml
<resource name="jdbc/mydb" auth="container" factory="oracle.ucp.jdbc.pooldatasourceimpl" type="oracle.ucp.jdbc.pooldatasource" description="oracle universal connection pool" connectionfactoryclassname="oracle.jdbc.pool.oracledatasource" minpoolsize="1" maxpoolsize="5" inactiveconnectiontimeout="20" connectionpoolname="ucppool" validateconnectiononborrow="true" sqlforvalidateconnection="select 1 dual" fastconnectionfailoverenabled="true" onsconfiguration="nodes=test11grac1.example.com:6200,test11grac2.example.com:6200" user="test" password="xxxx" url="jdbc:oracle:thin:@test11g-cluster.example.com:1521/testdb"/>
context.xml
<resourcelink name="jdbc/mydb" global="jdbc/mydb" />
initially configuration worked well. connections distributed evenly across 2 rac instances , when 1 instance went down subsequent request directed working one.
after night of idle time requests connection pool caused following exception:
caused by: java.lang.nullpointerexception: null @ oracle.ucp.jdbc.oracle.oraclejdbcconnectionpool.createonepooledconnection(oraclejdbcconnectionpool.java:1260) ~[ucp.jar:11.2.0.3.0] @ oracle.ucp.common.universalconnectionpoolimpl.borrowconnectionwithoutcountingrequests(universalconnectionpoolimpl.java:339) ~[ucp.jar:11.2.0.3.0] @ oracle.ucp.common.universalconnectionpoolimpl.borrowconnectionandvalidate(universalconnectionpoolimpl.java:168) ~[ucp.jar:11.2.0.3.0] @ oracle.ucp.common.universalconnectionpoolimpl.borrowconnection(universalconnectionpoolimpl.java:143) ~[ucp.jar:11.2.0.3.0] @ oracle.ucp.jdbc.jdbcconnectionpool.borrowconnection(jdbcconnectionpool.java:157) ~[ucp.jar:11.2.0.3.0] @ oracle.ucp.jdbc.pooldatasourceimpl.getconnection(pooldatasourceimpl.java:931) ~[ucp.jar:11.2.0.3.0] @ oracle.ucp.jdbc.pooldatasourceimpl.getconnection(pooldatasourceimpl.java:873) ~[ucp.jar:11.2.0.3.0] @ oracle.ucp.jdbc.pooldatasourceimpl.getconnection(pooldatasourceimpl.java:863) ~[ucp.jar:11.2.0.3.0] @ org.hibernate.ejb.connection.injecteddatasourceconnectionprovider.getconnection(injecteddatasourceconnectionprovider.java:46) ~[hibernate-entitymanager-3.4.0.ga.jar:3.4.0.ga]
what may cause exception , there workaround?
after upgrading ojdbc6.jar
, ucp.jar
latest (12c) versions. problem magically went away.
Comments
Post a Comment