saif-hmk / javamelody

Automatically exported from code.google.com/p/javamelody
0 stars 0 forks source link

Java Melody setting autoCommit(false) on JDBC Connections obtained from Datasources #233

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use datasources that are configured to be autocommit=true
2. Use Java Melody - JM is changing the autoCommit flag on connections but not 
reverting it back to the original setting
3. when the existing web app uses connections from the datasource that were 
previously used by javaMelody, exceptions are thrown as autoCommit is mandatory 
(host systems are iseries/as400 and are not configured for transactional 
control)

What is the expected output? What do you see instead?

Our application experiences exceptions when datasource connnections are used 
that were previously used by javamelody

What version of the product are you using? On what application server, JDK,
operating system?

Please provide any additional information below.

This is in reference to a previous issue, #189.  I wasn't sure if I could 
re-open an issue.  

This bug still is not fixed. I believe there are a few other places in the 
source code that are still setting autoCommitt(false).  As of version 1.3.9, 
they are:

DatabaseInformations.java(256): connection.setAutoCommit(false);
JavaInformations.java(360): connection.setAutoCommit(false);
JavaInformations.java(377): connection.setAutoCommit(false);
SpringTestFacadeImpl.java(49): connection.setAutoCommit(false);

Original issue reported on code.google.com by tkosa...@gmail.com on 29 Jun 2012 at 12:53

GoogleCodeExporter commented 9 years ago
For the first and second, this is used only with the JdbcDriver and not when 
there is a datasource. I prefer to keep setAutoCommit(false) in this case.

For the fourth, this is for unit tests and it is not in the package for 
applications monitoring. So this case can be ignored.

For the third, yes it is a connection from a datasource. I should certainly 
have removed the setAutoCommit(false) on this one with the issue 189, sorry.
Anyway it is removed now and committed in trunk (revision 2927), ready for the 
next release (1.40).

I have made a new build from the trunk, including the fix, and it is available 
at:
http://javamelody.googlecode.com/files/javamelody-20120701.jar

Original comment by evernat@free.fr on 1 Jul 2012 at 4:27