25 Benefits of TOMCAT7 database connection pool TOMCATJDBC

Source: Internet
Author: User

Tomcat's JDBC Connection pool org.apache.tomcat.jdbc.pool replaced or replaced Apache Commons dbcp connection pool.
Why do we need a new connection pool?
Here are a few reasons:
1.DBCP 1.x is single-threaded. In order to become a thread-safe shared lock the entire pool is allocated within a short time and objects are returned in two objects. Note that this does not apply to the House of Commons DBCP 2.x.
2.DBCP 1.x can be slow. The increase in the number of logical CPUs and the number of concurrent threads attempts to borrow or return an increase in the object performance degrades. Can have a significant impact on high-concurrency systems. Please note that this does not apply to Commons DBCP 2.x.
3.DBCP over 60 classes. The Tomcat-jdbc-pool core is Class 8, so future requirements will require fewer changes. This is all you need to run the connection pool itself rest is gravy.
The 4.DBCP uses a static interface. This means that you must use the correct version for the given JRE version or you may see the nosuchmethodexception exception.
5. It is not worth rewriting more than 60 classes when a connection pool is a simpler implementation to complete.
The 6.Tomcat JDBC Pool implements the ability to retrieve connections asynchronously without adding additional line libraries itself.
The 7.Tomcat JDBC Pool is a tomcat module, depending on Tomcat Jolie, a simplified log framework for Tomcat.
8. Retrieve the underlying connection using the Javax.sql.PooledConnection interface.
9. Proof of hunger. If the pool is empty, and the thread is waiting to return the connection, the correct thread waits while the connection is being woken. Most pools will starve only.
10. Features add additional connection pool implementations
11. Support High Concurrency environment and multi-core/CPU system.
12. Dynamically implemented interfaces will support java.sql and Javax.sql interfaces to your runtime environment (as long as your JDBC driver does the same thing), even if the lower version of the JDK is compiled.
13. Verify the Interval--we do not need to verify every connection we use, we can do this when we borrow or return the connection, it is not we can configure more frequently than the interval.
14.run-once query, a configurable query that will run only once when connected to the database. It is very useful to set the session settings that you want to exist throughout the time to establish a connection.
15. Configure the ability to customize the interceptor. This allows you to write custom interceptors to enhance functionality. You can use interceptors to collect query statistics, cache session state, reconnect failures, retry queries, cache query results, and so on. Your choice is endless, interceptors are dynamic, not tied to a JDK version of the Java.sql/javax.sql interface.
16. High performance-we will show some performance differences
17. Very simple, due to very simplified implementation, the number of rows and source files is very low, and c3p0 compared to more than 200 source files (last we checked), Tomcat JDBC 8 core files, the connection pool itself is half that error can occur, they will be faster tracking, and easier to repair. Reducing complexity has been the focus from inception.
18. Asynchronous retrieval--You can connect your connection request and receive queue future<connection> back.
19. Better idle connection processing. Instead of shutting down the connection directly, it can still connect the pool size and the smart algorithm of the free pool.
20. You can decide when the connection is considered abandoned, when the pool is full, or directly in time-out by specifying a pool of usage thresholds.
21. Discard the connection timer to post a statement of the Reset/query activity. Allows a connection to be used for a long period of time without timeouts. This is done by using the Resetabandonedtimer
22. After closing the connection, connect for a specific time. The age is close based on returning to the pool.
23.JMX notification when the connection is suspected to be an obsolete log entry. This is similar to the removeabandonedtimeout but it does not take any action, just report the information. This is done by using the Suspecttimeout property.
24. Connections can be retrieved from Java.sql.driver,javax.sql.datasource or Javax.sql.XADataSource this is by using the DataSource and Datasourcejndi properties.
25. Support JMX, support XA Connection
25 Advantages of TOMCAT7 database connection pool TOMCATJDBC

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.