-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 
Author Message
 Post subject: Connection pooling problem
PostPosted: Thu Jul 28, 2005 7:38 am 
Newbie

Joined: Thu Jul 28, 2005 4:49 am
Posts: 3
I've searched for this about one week, and still no answer. I'm not sure what this problem is about

I 've been using MySql 4.1, Tomcat 5, hibernate2, Spring 1.1.5 together without problem.

Until i changed the DriverManagerDataSource of Spring into a connection pooling source; C3P0 0.9.0 pre6 (or DBCP)

Now, after some time like 5-10 mins (i guess time decreases with concurrent user count), tomcat gives an error :

org.apache.tomcat.util.threads.ThreadPool logFull
SEVERE : All threads(150) are currently busy, waiting. Increase maxThreads or check servlet status



After this error, tomcat doesnt let any other connection.

Ofcourse, i tried to increase max thread, just delayed the error.

I dont think this is something about MySql, because same error with different consequences happens with Oracle too.

I dont know what to do. Somehow, somewhere threads are not being released

Any guidance would be appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 28, 2005 9:14 am 
Newbie

Joined: Sat Jul 23, 2005 8:31 am
Posts: 18
the requests aren't finished. this can be a bug somwhere in your app. on linux you can use kill to get stacktraces of all the threads and find out where they hang.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 28, 2005 9:23 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
close session, it will return connection to pool.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 28, 2005 9:45 am 
Newbie

Joined: Thu Jul 28, 2005 4:49 am
Posts: 3
thx for reply chrigi

it works without connection pooling, which made me think i'm doing something wrong about one of the frameworks, most probably hibernate or pool library.

anyway, do you know, in windows how can i find where threads are stuck?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 28, 2005 9:51 am 
Newbie

Joined: Thu Jul 28, 2005 9:33 am
Posts: 4
Place these lines between <resource> </resource> of the


in the (assuming tomcat 5.0) ../conf/Catalina/localhost/(your_application).xml

<parameter>
<name>removeAbandonedTimeout</name>
<value>60</value>
</parameter>
<parameter>
<name>logAbandoned</name>
<value>true</value>
</parameter>
</ResourceParams>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 28, 2005 9:56 am 
Newbie

Joined: Thu Jul 28, 2005 9:33 am
Posts: 4
Place these lines in your application's config file where you configure the connection pool. I am assuming DBCP.

(assuming tomcat 5.0)your application's config file will be ../conf/Catalina/localhost/(your_application).xml

<parameter>
<name>removeAbandonedTimeout</name>
<value>60</value>
</parameter>
<parameter>
<name>logAbandoned</name>
<value>true</value>
</parameter>
.
.
.
</ResourceParams>

This gives lots of logs which may help you pin point the location of the problem.

Cheers - I think, therefore I survive.
J2EE_pro


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 28, 2005 10:26 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Just find Filter implementation for spring to close connections (see some spring example and paste filter configuration to web.xml)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 29, 2005 2:49 am 
Newbie

Joined: Thu Jul 28, 2005 4:49 am
Posts: 3
baliukas, do you mean OpenSessionInViewFilter? I'm using OpenSessionInViewInterceptor, and what i see from its log outputs, it seems to be flushing and closing session

anyway, if it wouldnt close session, the code without connection pooling would run out of resources soon too, am i wrong?


(J2EE_pro : thx, but i couldnt make it work, no more logs...)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 29, 2005 3:11 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Try "kill -3" or "Ctrl + Pause" on windows, you will see stack trace for all threads, but it looks like connection is not returned to pool and threads block in "getConnection()" ( or plian connection startup is faster than pool).


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.