panmissl / javamelody

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

Javamelody is setting autoCommit to false on datasource connections #189

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 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?

Tomcat 7, Windows X64, JDK 6/7, JavaMelody 1.2.9, Tomcat JDBC pool, 
com.ibm.as400.access.AS400JDBCDriver (driver), autoCommit=true, IBM 
ISeries/AS400 DB2 database.

Please provide any additional information below.

I believe it's just the issue that when javaMelody uses a connection from a 
datasource pool, it does not reset the autoCommit property back to its original 
value.

Original issue reported on code.google.com by tkosa...@gmail.com on 24 Feb 2012 at 3:35

GoogleCodeExporter commented 8 years ago

Original comment by evernat@free.fr on 24 Feb 2012 at 9:24

GoogleCodeExporter commented 8 years ago
that's true.

I've now removed the "connection.setAutoCommit(false)" when getting a 
connection from a DataSource. In fact, it was just set based on general habit 
and not necessity. And it was not a good idea for the rare applications needing 
the autoCommit true afterwards.

It is committed in trunk (revision 2570) and ready for the next release (1.36).

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

Original comment by evernat@free.fr on 4 Mar 2012 at 12:48

GoogleCodeExporter commented 8 years ago
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 comment by tkosa...@gmail.com on 27 Jun 2012 at 3:55

GoogleCodeExporter commented 8 years ago
follow up in issue 233

Original comment by evernat@free.fr on 1 Jul 2012 at 12:44