There are various types of Connection pooling. which are listed below.
1. DBCP2 Connection pooling
By Default Hibernate uses a C3P0 Connection pooling for creating connections. From performance point of view HikariCP is best as it can handle large number of concurrent connections. while BoneCP is alternative to C3PO & provide following good features
- Highly scalable, fast connection pool
- Callback (hook interceptor) mechanisms on a change of connection state.
- Partitioning capability to increase performance
- Allows direct access to a connection/statements
- Automatic resizing of pool
- Statement caching support
- Support for obtaining a connection asynchronously (by returning a Future<Connection>)
- Release helper threads to release a connection/statement in an asynchronous fashion for higher performance.
- Easy mechanism to execute a custom statement on each newly obtained connection (initSQL).
- Support to switch to a new database at runtime without shutting down an application
- Ability to replay any failed transaction automatically (for the case where database/network goes down etc)
- JMX support
- Lazy initialization capable
- Support for XML/property configuration
- Idle connection timeouts / max connection age support
- Automatic validation of connections (keep-alives etc)
- Allow obtaining of new connections via a datasource rather than via a Driver
- Datasource/Hibernate support capable
- Debugging hooks to highlight the exact place where a connection was obtained but not closed
- Debugging support to show stack locations of connections that were closed twice.
- Custom pool name support.
- Clean organised code. 100% unit test branch code coverage (over 180 JUnit tests).
- Free, open source and written in 100% pure Java with complete Javadocs.