开发者

Does the transactionManager close the statement atuomatically?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜