views:

142

answers:

1

Hello Friends! I need some help in session management for database in hibernate. Working with struts2 and hibernate. I have gone through simple apps. Now I want my Database connection in Startup so that I don't need to make connection overhead everytime I request. In short How to configure my hibernate session in ServletContextListener. or is there any other way?? Thanks in advance.

A: 

Best way to proceed would be to use some connection pool so the database connections are started at the beginning and they are managed to acquire new ones or keep a number of them open by configuration. There are many options, ones of the most extended are DBCP or C3P0.

pedromarce
Thanks... will check that out..!!
Hrushikesh

related questions