Link to home
Start Free TrialLog in
Avatar of Ashok9
Ashok9Flag for India

asked on

c3p0 mysql hibernate configuration

It creates 225 connections. so my tomcat serves for 225 requests and after that those connections goes to sleep mode in mysql. So further requests to tomcat are not responded. Please let me know what changes to be done to overcome this. Because this is currently in production.

Hibernate configuration

                <property name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
                <property name="hibernate.c3p0.min_size">5</property>
                <property name="hibernate.c3p0.max_size">225</property>

Open in new window

Avatar of girionis
girionis
Flag of Greece image

You can change the value from 225 to a higher number.
Avatar of Ashok9

ASKER

Ideally it should reuse the connections. But why its not using existing connections? Also all the connections are sleeping...?
Have you set max_statements? (I'm just guessing here)

  <property name="hibernate.c3p0.max_statements">50</property>
Avatar of Ashok9

ASKER

what does max_statements do? Does it stop using connection after the max_statements?
Avatar of Ashok9

ASKER

I tried it with the value of 10. but it was of no use it again makes connections to sleep mode.
Avatar of dcpetersonp
dcpetersonp

ASKER CERTIFIED SOLUTION
Avatar of c_kedar
c_kedar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial