You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Innovest Ken <in...@yahoo.com> on 2004/05/25 09:26:07 UTC

Thread stuck at getting database connection and PoolableConnectionFactory.validateObject

hello,

I found from my thread dump that 80% of my thread are
at the following stage, waiting to lock
PoolableConnectionFactory. This is the cause of my
Tomcat hanging! Do I need to reconfigure my
server.xml?

	             <parameter>
	               <name>maxIdle</name>
	               <value>10</value>
	             </parameter>
	             <parameter>
	               <name>maxActive</name>
	               <value>150</value>
	             </parameter>
	             <parameter>
	               <name>driverClassName</name>
	              
<value>oracle.jdbc.driver.OracleDriver</value>
	             </parameter>
	             <parameter>
	               <name>maxWait</name>
	               <value>10000</value>
	             </parameter>
	             <parameter>
	               <name>removeAbandoned</name>
	               <value>false</value>
	             </parameter>
	             <parameter>
	               <name>removeAbandonedTimeout</name>
	               <value>60</value>
	             </parameter>
		     <parameter>
			<name>logAbandoned</name>
			<value>true</value>
		     </parameter>
		     <parameter>
	               <name>factory</name>
	              
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
	             </parameter>
				 <parameter>
	               <name>username</name>
	               <value>nokia</value>
	             </parameter>
	             <parameter>
	               <name>password</name>
	               <value>pswpnokia</value>
	             </parameter>
				 <parameter>
                   <name>validationQuery</name>
                   <value>select count(*) from
dual</value>
                 </parameter>
	             <parameter>
	              
<name>timeBetweenEvictionRunsMillis</name>
	               <value>60000</value>
	             </parameter>
	             <parameter>
	               <name>numTestsPerEvictionRun</name>
	               <value>3</value>
	             </parameter>
	             <parameter>
	              
<name>minEvictableIdleTimeMillis</name>
	               <value>120000</value>
	             </parameter>


Following is the extract from thread dump:

"http80-Processor228" daemon prio=1 tid=0x085a94d0
nid=0x275b waiting for monitor entry
[acdff000..acdff8d8]
	at
org.apache.commons.dbcp.PoolableConnectionFactory.validateObject(PoolableConnectionFactory.java:316)
	- waiting to lock <0x4d107d78> (a
org.apache.commons.dbcp.PoolableConnectionFactory)
	at
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:833)
	at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:140)
	at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:518)






	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: Thread stuck at getting database connection and PoolableConnectionFactory.validateObject

Posted by Dirk Verbeeck <di...@pandora.be>.
Right, shouldn't be a problem.

-- Dirk

Innovest Ken wrote:

> hi Dirk,
> 
> Sorry, one more question:
> 
> If I upgrade my oracle jdbc driver to  Oracle9i
> 9.2.0.3 JDBC Drivers, it should run ok with dbcp 1.2
> right?
> 
> innovest
> 
> --- Dirk Verbeeck <di...@pandora.be> wrote:
> 
>>Hi Innovest
>>
>>Yes, the existing configuration parameters remain
>>the same.
>>v1.2 has one new parameter: initialSize
>>
>>-- Dirk




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: Thread stuck at getting database connection and PoolableConnectionFactory.validateObject

Posted by Innovest Ken <in...@yahoo.com>.
hi Dirk,

Sorry, one more question:

If I upgrade my oracle jdbc driver to  Oracle9i
9.2.0.3 JDBC Drivers, it should run ok with dbcp 1.2
right?

innovest

--- Dirk Verbeeck <di...@pandora.be> wrote:
> Hi Innovest
> 
> Yes, the existing configuration parameters remain
> the same.
> v1.2 has one new parameter: initialSize
> 
> -- Dirk
> 
> Innovest Ken wrote:
> 
> > hello Dirk,
> > 
> > Thanks for your suggestions, I'll try v1.2 and
> > feedback to you. But is the configuration on
> tomcat
> > server.xml of dbcp v1.2 same as that of dbcp v1.1,
> eg,
> > the parameter setting like minIdle can remain the
> > same?
> > 
> > Innovest
> 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> commons-user-help@jakarta.apache.org
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Problem after using dbcp 1.2 at PoolableConnectionFactory

Posted by Innovest Ken <in...@yahoo.com>.
hi all,

Got a problem after using the new v1.2 dbcp file. The
tomcat will hang after sometime. I did a thread dump,
and discover that all threads are waiting to get
connection. But 1 thread is locking the
org.apache.commons.dbcp.PoolableConnectionFactory.

The following thread 196 is locking the
PoolableConnectionFactory while all other threads are
waiting for the factory class...

And I also notice that although I have installed the
latest Oracle driver file, in the server.xml I put 
<value>oracle.jdbc.OracleDriver</value>, but the
thread dump below still shows
oracle.jdbc.driver.OracleDriver. Any idea why?

"http80-Processor196" daemon prio=1 tid=0x59f322f8
nid=0x298a waiting for monitor entry
[aabfe000..aabff8d8]
        at
oracle.net.ano.AuthenticationService.a(AuthenticationService)
        at oracle.net.ano.Ano.e(Ano)
        at oracle.net.ano.Ano.init(Ano)
        at oracle.net.ns.NSProtocol.connect(Unknown
Source)
        at
oracle.jdbc.ttc7.TTC7Protocol.connect(TTC7Protocol.java:1689)
        at
oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:215)
        - locked <0x48a1cd58> (a
oracle.jdbc.ttc7.TTC7Protocol)
        at
oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:360)
        at
oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:521)
        at
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:325)
        at
org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37)
        at
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
        - locked <0x49f62f40> (a
org.apache.commons.dbcp.PoolableConnectionFactory)
        at
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:771)
        at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95)
        at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)



"http80-Processor200" daemon prio=1 tid=0x082aeb80
nid=0x2b54 waiting for monitor entry
[a9bff000..a9bff8d8]
        at
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
        - waiting to lock <0x49f62f40> (a
org.apache.commons.dbcp.PoolableConnectionFactory)
        at
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:771)
        at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95)
        at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)



 



	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: Thread stuck at getting database connection and PoolableConnectionFactory.validateObject

Posted by Innovest Ken <in...@yahoo.com>.
hi Dirk,

Got a problem after using the new v1.2 dbcp file. The
tomcat will hang after sometime. I did a thread dump,
and discover that all threads are waiting to get
connection. But 1 thread is locking the
org.apache.commons.dbcp.PoolableConnectionFactory.

The following thread 196 is locking the
PoolableConnectionFactory while all other threads are
waiting for the factory class...

And I also notice that although I have installed the
latest Oracle driver file, in the server.xml I put 
<value>oracle.jdbc.OracleDriver</value>, but the
thread dump below still shows
oracle.jdbc.driver.OracleDriver. Any idea why?

"http80-Processor196" daemon prio=1 tid=0x59f322f8
nid=0x298a waiting for monitor entry
[aabfe000..aabff8d8]
        at
oracle.net.ano.AuthenticationService.a(AuthenticationService)
        at oracle.net.ano.Ano.e(Ano)
        at oracle.net.ano.Ano.init(Ano)
        at oracle.net.ns.NSProtocol.connect(Unknown
Source)
        at
oracle.jdbc.ttc7.TTC7Protocol.connect(TTC7Protocol.java:1689)
        at
oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:215)
        - locked <0x48a1cd58> (a
oracle.jdbc.ttc7.TTC7Protocol)
        at
oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:360)
        at
oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:521)
        at
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:325)
        at
org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37)
        at
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
        - locked <0x49f62f40> (a
org.apache.commons.dbcp.PoolableConnectionFactory)
        at
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:771)
        at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95)
        at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)



"http80-Processor200" daemon prio=1 tid=0x082aeb80
nid=0x2b54 waiting for monitor entry
[a9bff000..a9bff8d8]
        at
org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
        - waiting to lock <0x49f62f40> (a
org.apache.commons.dbcp.PoolableConnectionFactory)
        at
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:771)
        at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95)
        at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: Thread stuck at getting database connection and PoolableConnectionFactory.validateObject

Posted by Dirk Verbeeck <di...@pandora.be>.
Hi Innovest

Yes, the existing configuration parameters remain the same.
v1.2 has one new parameter: initialSize

-- Dirk

Innovest Ken wrote:

> hello Dirk,
> 
> Thanks for your suggestions, I'll try v1.2 and
> feedback to you. But is the configuration on tomcat
> server.xml of dbcp v1.2 same as that of dbcp v1.1, eg,
> the parameter setting like minIdle can remain the
> same?
> 
> Innovest




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: Thread stuck at getting database connection and PoolableConnectionFactory.validateObject

Posted by Innovest Ken <in...@yahoo.com>.
hello Dirk,

Thanks for your suggestions, I'll try v1.2 and
feedback to you. But is the configuration on tomcat
server.xml of dbcp v1.2 same as that of dbcp v1.1, eg,
the parameter setting like minIdle can remain the
same?

Innovest
--- Dirk Verbeeck <di...@pandora.be> wrote:
> You can try the almost released 1.2 version.
> The lock on the
> PoolableConnectionFactory.validateObject was removed
> 
> as a performance optimization.
> 
> Release candidates are available from:
>
http://jakarta.apache.org/commons/pool/downloads.html
>
http://jakarta.apache.org/commons/dbcp/downloads.html
> 
> -- Dirk
> 
> Innovest Ken wrote:
> 
> > hello,
> > 
> > I found from my thread dump that 80% of my thread
> are
> > at the following stage, waiting to lock
> > PoolableConnectionFactory. This is the cause of my
> > Tomcat hanging! Do I need to reconfigure my
> > server.xml?
> 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> commons-user-help@jakarta.apache.org
> 



	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: Thread stuck at getting database connection and PoolableConnectionFactory.validateObject

Posted by Dirk Verbeeck <di...@pandora.be>.
You can try the almost released 1.2 version.
The lock on the PoolableConnectionFactory.validateObject was removed 
as a performance optimization.

Release candidates are available from:
http://jakarta.apache.org/commons/pool/downloads.html
http://jakarta.apache.org/commons/dbcp/downloads.html

-- Dirk

Innovest Ken wrote:

> hello,
> 
> I found from my thread dump that 80% of my thread are
> at the following stage, waiting to lock
> PoolableConnectionFactory. This is the cause of my
> Tomcat hanging! Do I need to reconfigure my
> server.xml?




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


R: Thread stuck at getting database connection and PoolableConnectionFactory.validateObject

Posted by daniele rizzi <da...@essellesse.net>.
a/ download the latest jdbc drivers from technet.oracle.com
b/ turn oracle.jdbc.driver.OracleDriver into oracle.jdbc.OracleDriver 

hope may help
d.rizzi

-----Messaggio originale-----
Da: Innovest Ken [mailto:innovest_11@yahoo.com]
Inviato: martedi 25 maggio 2004 9.26
A: commons-user@jakarta.apache.org
Oggetto: Thread stuck at getting database connection and
PoolableConnectionFactory.validateObject


hello,

I found from my thread dump that 80% of my thread are
at the following stage, waiting to lock
PoolableConnectionFactory. This is the cause of my
Tomcat hanging! Do I need to reconfigure my
server.xml?

	             <parameter>
	               <name>maxIdle</name>
	               <value>10</value>
	             </parameter>
	             <parameter>
	               <name>maxActive</name>
	               <value>150</value>
	             </parameter>
	             <parameter>
	               <name>driverClassName</name>
	              
<value>oracle.jdbc.driver.OracleDriver</value>
	             </parameter>
	             <parameter>
	               <name>maxWait</name>
	               <value>10000</value>
	             </parameter>
	             <parameter>
	               <name>removeAbandoned</name>
	               <value>false</value>
	             </parameter>
	             <parameter>
	               <name>removeAbandonedTimeout</name>
	               <value>60</value>
	             </parameter>
		     <parameter>
			<name>logAbandoned</name>
			<value>true</value>
		     </parameter>
		     <parameter>
	               <name>factory</name>
	              
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
	             </parameter>
				 <parameter>
	               <name>username</name>
	               <value>nokia</value>
	             </parameter>
	             <parameter>
	               <name>password</name>
	               <value>pswpnokia</value>
	             </parameter>
				 <parameter>
                   <name>validationQuery</name>
                   <value>select count(*) from
dual</value>
                 </parameter>
	             <parameter>
	              
<name>timeBetweenEvictionRunsMillis</name>
	               <value>60000</value>
	             </parameter>
	             <parameter>
	               <name>numTestsPerEvictionRun</name>
	               <value>3</value>
	             </parameter>
	             <parameter>
	              
<name>minEvictableIdleTimeMillis</name>
	               <value>120000</value>
	             </parameter>


Following is the extract from thread dump:

"http80-Processor228" daemon prio=1 tid=0x085a94d0
nid=0x275b waiting for monitor entry
[acdff000..acdff8d8]
	at
org.apache.commons.dbcp.PoolableConnectionFactory.validateObject(PoolableConnectionFactory.java:316)
	- waiting to lock <0x4d107d78> (a
org.apache.commons.dbcp.PoolableConnectionFactory)
	at
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:833)
	at
org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:140)
	at
org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:518)






	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org