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....