Connection Leak, using JDBCTemplate
Hi, I'm using Spring JDBCTemplate, Weblogic 8.16
When I used Spring 1.2.8, it worked fine, but with 2.0 RC3 I'm getting following Weblogic warnings:
<29.08.2006 16:39:42 EEST> <Warning> <JDBC> <BEA-001074> <A JDBC pool connection leak was detected. A connection leak occurs when a connection obtained from the pool was not closed explicitly by calling close() and then was disposed by the garbage collector and returned to the connection pool. The following stack trace at create shows where the leaked connection was created. JTAConnection leaked due to using it in xa mode without close it.>
My code:
JdbcTemplate jdbc = new JdbcTemplate(dataSource);
long[] tehingArray = new long[]{1,2};
ArrayDescriptor descriptor = ArrayDescriptor.createDescriptor("TABLE_OF_NUMBER" , dataSource.getConnection() );
oracle.sql.ARRAY array = new oracle.sql.ARRAY(descriptor, dataSource.getConnection(), tehingArray);
Object[] args = {array};
String stmt = "update table r set r.field=? where id in (select * from table(cast(? as TABLE_OF_NUMBER))))";
jdbc.update(stmt,args);
Seems like jdbc.update does not close the connection?