Atomikos Forum

Forcing close of pending Statement

Hi,

this has been discussed previously but that discussion is closed.

The setup:
- Spring Transaction demarcation
- Spring JTATransactionmanager
- Atomikos with XA DataSource
- MySQL Driver (5.1.18)
- Pure JDBC calls (using Springs DataSourceUtils.getConnection())

Although the code is very clean (all statements are closed) we get thousands of warning that statements have not been closed. Increasing the log level would be a "soluton" but nothing that I would consider clean.

- As noted in the other thread, default82df.html?community.6.2221.16:
Atomikos' AbstractConnectionProxy never removes statements, unless they are forcefully closed.
- A connection.close() cures the symtoms because then warnings in forceCloseAllPendingStatements are suppressed.
This is at the moment the only "solution" to get rid of the warning but has side-effects. When you're letting spring manage your connections (binding them as transaction sychronizaton), you must be way to careful not to mess up connection management.
- forceCloseAllPendingStatements(...) does not actually check if the closed statement was already closed. An isClosed() check would at least help in this situation.
- As a related MySQL Connector bug, when calling close() on a JDBC4PreparedStatementWrapper, all the following isClose() calls return false (the wrapped statement is null'ed)
- Would it be possible, to selectively turn off these warnings via some configurable setting?
Magnus Jungsbluth Send private email
Wednesday, February 01, 2012
 
 
These warnings will no longer appear as warnings in the next release.

Thanks for the input!
Guy Pardon Send private email
Monday, February 06, 2012
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics