lemonzone2010 / javamelody

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

Support of rewrap-datasource for org.apache.tomcat.jdbc.pool.DataSource #417

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a datasource of type org.apache.tomcat.jdbc.pool.DataSource in 
<Resource> in server.xml for Tomcat
2. The datasource JNDI is something like java:/comp/env/myDS
3. Set the system property Djavamelody.rewrap-datasources=true

I did check the code for net.bull.javamelody.JdbcWrapper.rewrapDataSource() but 
there is no logic for org.apache.tomcat.jdbc.pool.DataSource. Any plans for 
supporting "org.apache.tomcat.jdbc.pool.DataSource" in near feature ?

What is the expected output? What do you see instead?
I see the log message  
DEBUG     Datasource needs rewrap: java:comp/env/myDataSource of class 
org.apache.tomcat.jdbc.pool.DataSource

But No SQL Statistics, need to see SQL Statistics

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

Using javamelody 1.51.0 version, Tomcat 7.0.54

Please provide any additional information below.

Original issue reported on code.google.com by ashokthe...@gmail.com on 9 Jul 2014 at 7:25

GoogleCodeExporter commented 9 years ago
In general, the JNDI name of a jdbc datasource is java:/comp/env/jdbc/myDS, not 
java:/comp/env/myDS
But given the log, it seems that you have also used the javamelody.datasources 
parameter.

The rewrap-datasources is not documented and not supported. So this an 
enhancement and not a bug.

There is no plan to support rewrap of org.apache.tomcat.jdbc.pool.DataSource, 
unless you do it. Make a change, test it, then submit a patch: 
https://code.google.com/p/javamelody/wiki/DevGuide
Do you want to do that?

Original comment by evernat@free.fr on 11 Jul 2014 at 1:58

GoogleCodeExporter commented 9 years ago
Are you there?

Original comment by evernat@free.fr on 19 Jul 2014 at 12:12

GoogleCodeExporter commented 9 years ago
yes, i am trying to fix the issue and submit a patch.

Original comment by ashokthe...@gmail.com on 21 Jul 2014 at 7:05

GoogleCodeExporter commented 9 years ago
ok, thanks

Original comment by evernat@free.fr on 21 Jul 2014 at 7:59

GoogleCodeExporter commented 9 years ago

Original comment by evernat@free.fr on 6 Apr 2015 at 3:02

GoogleCodeExporter commented 9 years ago
[Triage]
As said before, javamelody already supports monitoring of datasource in Tomcat 
when the JNDI name is like "jdbc/MyDataSource". For example, when the 
dataSource is looked-up with:
new InitialContext().lookup("java:/comp/env/jdbc/myDataSource")

javamelody even supports reading properties of tomcat-jdbc datasources such as 
maxActive, testOnBorrow, validationQuery, etc...

But as said above, rewrap-datasources is a specific case parameter not 
documented and not officially supported.
Given that no patch was submitted, this issue is "won't fix" for the moment.

Original comment by evernat@free.fr on 6 Apr 2015 at 3:10