-->
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 Configuration issue
PostPosted: Thu Dec 03, 2009 4:02 am 
Beginner
Beginner

Joined: Sun Jul 12, 2009 9:53 am
Posts: 21
Hi all,

I have a webapplication that uses the C3P0 Connection Pool with this configuration:
Code:
<property
name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider
        </property>
        <property name="c3p0.acquire_increment">3</property>
        <property name="c3p0.idle_test_period">100</property>
        <property name="c3p0.max_size">80</property>
        <property name="c3p0.max_statements">0</property>
        <property name="c3p0.min_size">0</property>
        <property name="c3p0.timeout">100</property>
   <property name="hibernate.c3p0.max_size">80</property>


But sometimes, I get the error (from the database) that I can't create a new connection because I already have to many. Watching the database's processlist, it seems that the connections are created although others are still "sleeping".

I get my sessions via sessionfactory.openSession(); this happens each time i persist or load something from the database.
I know about the CloseSessionInView-Pattern, but can not apply it, because of various reasons.

Where is my error in my config ? (Additionally, if the application runs idle it closes down all connections keeping only one open while I at least want to keep open 10). I am using MySQL (which closes idle connections on its own after some hours).

Please help, because the continuing errors are going to be to a real showstopper....


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.