db2 jdbc driver does not release table locks
Posted
by as
on Stack Overflow
See other posts from Stack Overflow
or by as
Published on 2010-03-19T10:29:23Z
Indexed on
2010/03/19
10:31 UTC
Read the original article
Hit count: 219
situation: We have a web service running on tomcat accessing DB2 database on AS400, we are using JTOPEN drivers for JNDI connections handled by tomcat. For handling transactions and access to database we are using Spring.
For each select system takes JDBC connection from JNDI (i.e. from connection pool), does selection, and in the end it closes ResultSet, Statement and releases Connection in that order. That passes fine, shared lock on table dissappears.
When we want to do update the same way as we did with select (exception on ResultSet object, we don't have one in such situation), after releasing Connection to JNDI lock on table stays.
If we put maxIdle=0 for number of connections in JNDI configuration, this problem disappears, but this degrades performances, we have cca 100 users online on that service, we need few connections to be alive in pool.
What do you suggest?
© Stack Overflow or respective owner