Does Hibernate use connection pool by default? If so what is the default value for *connection.pool_size*? Doesn't it conflicts with *hibernate.connection.release_mode*? Isn't the all idea of connection pooling is not closing connections?
The Hibernate Connection Pool Size property establishes the number of connections that are permitted between the Model repository and the Model Repository Service database. The default value is 10. In deployments with many concurrent connections, you can increase the property to increase performance.
The default connection pool in hibernate is c3p0 named after the star wars character. But hibernate supports also proxool and used to also advertise apache dbcp. For a while DBCP was dormant and fell out of grace. C3P0 is actually used in production in many projects.
pool_size indicates the maximum number of pooled connections. So it is better to keep it at a logical count. It depends on your application and DB how much it can handle. 10 is a reasonable count that will typically used as it is sufficient for most cases.
The default hibernate connection pool (which shouldn't be used in production) has a default limit of 1, since it is meant to just be used for simple testing. However this is configurable through the hibernate.properties file, so it's worth checking to see if it's defined there in your project.
The property in question is:
hibernate.connection.pool_size
Information on this is largely contained in this link:
http://docs.jboss.org/hibernate/orm/3.3/reference/en/html/session-configuration.html
While this doesn't directly specify the default connection pool size, it does have most of the information you could want on the subject of connection pooling in hibernate.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With