Posts

Showing posts with the label Hibernate Connection Pooling

Improving Hibernate's Performance

Connection Pooling:-         Opening a connection to a database is generally much more expensive than executing an SQL statement. A connection pool is used to minimize the number of connections opened between application and database. Much like a library, your application code needs to be strict about returning connections to the pool when complete, for if it does not do so, your application will run out of connections.This problem can be avoided by  always  using a  finally  block to close your connection, as shown throughout this book. Starving a Pool:-          Hibernate supports a variety of connection pooling mechanisms. If you are using an application server, you may wish to use the built-in pool (typically a connection is obtaining using JNDI). If you can't or don't wish to use your application server's built-in connection pool, Hibernate supports several other connection pools c3p0 http...