Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection pooling in Hibernate

 
Sarath Koiloth Ramath
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to do connection pooling in hibernate.I am starter in Hibernate.
 
Vasily Kukhta
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!

Try C3P0 to perform connection pooling. It is a library that includes DataSources that implement connection pooling.

You can download it from here.

To start using this library, just add c3p0-0.9.1.2.jar to your classpath and specify connection pooling service in your hibernate.cfg.xml file:

<property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>

Then specify minimum pool size with this line: <property name="hibernate.c3p0.min_size">10</property>

You may then tune C3P0 to needs of your application.
Please look here for information about additional configuration properties.

Best regards
Vasily
 
Sarath Koiloth Ramath
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Kukhta.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic