After a brief study, I found a solution on that. Dunno if it is most appropriate way but at least it is clear and easy.
The issue is in fact in XA situation, we are not using JDBC Driver but a Data Source in configuring our connection pool.
The solution I created is (as I am using Oracle) a subclass of OracleXADataSource (I called it OracleXADataSourceSpy), and it overrided getXAConnection and getConnection. For getXAConnection, I return a XAConnectionSpy which do some logging, and return ConnectionSpy when getXAConnection is called.
The problem of this solution is we have to depends on oracle's jar (or other DBMS client lib) during the compilation. I am not sure if it cause any issue in distribution too (probably not).
File Added: oracleSpy.zip
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OracleXADataSourceSpy
After a brief study, I found a solution on that. Dunno if it is most appropriate way but at least it is clear and easy.
The issue is in fact in XA situation, we are not using JDBC Driver but a Data Source in configuring our connection pool.
The solution I created is (as I am using Oracle) a subclass of OracleXADataSource (I called it OracleXADataSourceSpy), and it overrided getXAConnection and getConnection. For getXAConnection, I return a XAConnectionSpy which do some logging, and return ConnectionSpy when getXAConnection is called.
The problem of this solution is we have to depends on oracle's jar (or other DBMS client lib) during the compilation. I am not sure if it cause any issue in distribution too (probably not).
File Added: oracleSpy.zip