Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Connection pooling in Hibernate

 
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.
 
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.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic