-->
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.  [ 1 post ] 
Author Message
 Post subject: c3p0 acquires more connections than c3p0.max_size property
PostPosted: Fri Nov 06, 2009 9:22 am 
Newbie

Joined: Tue Jun 09, 2009 7:54 am
Posts: 10
Hi all,


Please note my Hibernate connection pooling settings and MySQL settings

Code:
<property name="c3p0.max_size">8</property>
      <property name="c3p0.min_size">5</property>
      <property name="c3p0.initial_pool_size">5</property>
      <property name="c3p0.timeout">200</property>

MySQL:
MaxConnections 200
Wait-timeout 100

1) Despite of having only 8 connections in the c3p0.max_size, the application went on to acquire 200 connections when requested for.
Also, the connections were killed after 100 seconds - not 200 seconds as specified in the hibernate configuration file.

2) Also, when the application requested for 10 connections, hibernate did not seem to use the
available connections right out of the pool. It acquired 10 extra connections.

3) While the webapp using Hibernate was running:

(a) I could see these logs:
Code:
1562426 [Timer-41] DEBUG com.mchange.v2.resourcepool.BasicResourcePool  - BEGIN check for expired resources.  [com.mchange.v2.resourcepool.BasicResourcePool@803f84]
1562426 [Timer-41] DEBUG com.mchange.v2.resourcepool.BasicResourcePool  - FINISHED check for expired resources.  [com.mchange.v2.resourcepool.BasicResourcePool@803f84]


(b) I kept observing the MySQL Administrator - Server Connections tab and noticed that though none of my code was running, newer connections (around 100 in number) were being established and destroyed after a few minutes.

Why do the MySQL properties override the Hibernate properties?
Please help.
Regards,
N


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

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.