Now we are using spring transactionManager to manager the DB transaction. Since we use a connection pool to hold all the connections, the connection will not be closed. I won开发者_JAVA百科der if the opended statement will be closed automatically after the transaction get failed and rollback?
We are using C3p in our project to maintain Connection pool. We have a configuration in it to close the connection after a transaction completes.
<prop key="connection.release_mode">after_transaction</prop>
So which transaction manager are you using?
No it won't. You should always explicitely close your statements, and do it in finally blocks. Or use Spring's JdbcTemplate which handles this for you.
精彩评论