lemonzone2010 / javamelody

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

Used and open jdbc connections charts always showing "0" #390

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Used / active jdbc connections are always 0

What version of the product are you using? On what application server, JDK,
operating system?
 - javamelody-core 1.49.0
 - Tomcat 6.0.36, jdk1.6.0_34 64 bit, Windows 7
 - Spring 3.2.6.RELEASE
 - ucp.jar from oracle website
 - ojdbc6.jar from oracle website

Please provide any additional information below.

Using Oracle UCP datasource with following tomcat config:
server.xml
       <Resource
       name="jdbc/UCPPool"
       auth="Container"
       factory="pl.test.PoolDataSourceImpl" 
       type="oracle.ucp.jdbc.PoolDataSource" 
       description="UCP POOL TOMCAT" 
       connectionFactoryClassName="oracle.jdbc.pool.OracleDataSource" 
       minPoolSize="2" 
       maxPoolSize="20" 
       inactiveConnectionTimeout="20" 
       user="xxx" password="xx" 
       url="jdbc:oracle:thin:@dev-oracle.ol:1521:dbdev" 
       connectionPoolName="UCPPool"
       validateConnectionOnBorrow="true"
       sqlForValidateConnection="select 1 from DUAL" />
______
context.xml

       <ResourceLink name="jdbc/UCPPool"
        global="jdbc/UCPPool"
        type="javax.DataSource"/>

I'm not able to see any changes in used/active jdbc connections chart.
Javamelody jar is on the classpath.
____ 

Please find web.xml as well as mvc config attached.
Thank You for Your time,
Regards,
Maciej 

Original issue reported on code.google.com by eko...@gmail.com on 19 Mar 2014 at 12:39

Attachments:

GoogleCodeExporter commented 9 years ago
UPDATE: Charts are showing jdbc connections, when setting 
javamelody.resolution-seconds=1. With default 60 seconds, I was not able to see 
any used or active connections - in that case, I think that this defect could 
be ok to close, if I misunderstood how this parameter should be used. 
Meanwhile, could You please guide me, what is the impact of this parameter? 
Imho setting parameter to 60 secs should cause, that jdbc connection data will 
be presented with up to 60 second delay - is the above statement correct?

In summary:
I've set javamelody.resolution-seconds=1
I changed the mvc config to use javamelody wrapper: 

 <bean id="_dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName" value="java:comp/env/jdbc/UCPPool" />
 </bean>

 <bean id="dataSource" class="net.bull.javamelody.SpringDataSourceFactoryBean">
        <property name="targetName" value="_dataSource" />
 </bean>

Original comment by eko...@gmail.com on 20 Mar 2014 at 8:43

GoogleCodeExporter commented 9 years ago
Update 2:
Ok to close, according to:
"When an application is sparsely or not used, the charts of active threads and 
of active jdbc connections stay at 0. Indeed, most requests are fortunately 
short and most measures (done each 2 minutes for example) are taken without 
active requests, except 1 or 2 occasionally shown as a peak." - because of that 
I might not be able to find data on local dev environment, due to 60 seconds 
probe and query/call execution time at around 141us .

Original comment by eko...@gmail.com on 20 Mar 2014 at 9:01

GoogleCodeExporter commented 9 years ago
Yes, absolutely

Original comment by evernat@free.fr on 20 Mar 2014 at 10:14