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 number of logical CPUs added and the number of concurrent threads attempts to borrow or return the addition of an object, performance is reduced. 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 demand will require less change.

This is all you need to do to connect the pool itself to rest is gravy.
The 4.DBCP uses a static interface.

This means that you must use the correct version number for the given JRE version number 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 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. Assuming 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 simply starve.
10. Features added other connection pool implementations
11. Support High Concurrency environment and multi-core/CPU system.
12. Dynamically implemented interfaces that will support java.sql and JAVAX.SQL interfaces to your execution-time environment (just want your JDBC driver to do the same thing) even if the lower version number of the JDK is compiled.
13. Verification Interval-We do not need to verify every connection we use, we are able to 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 be executed only once when connected to the database. It is useful to set the session settings that you want to exist throughout the time to establish the connection.


15. Configure your ability to define interceptors. This allows you to write your own definition interceptors to enhance functionality. You can use interceptors to collect query statistics, cache session state, connect failures again, retry queries, cache query results, and so on. Your choice is endless, the interceptor is dynamic, not the Java.sql/javax.sql interface bound to a JDK version number.
16. High performance-we will show some performance differences
17. Very easy, because it is easy to implement, 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.

The reduction in complexity has always been focused on the inception of the Dream space.


18. Asynchronous retrieval--You can connect your connection request and receive queue future<connection> back.


19. Better spare connection processing. Instead of shutting down the connection directly, it is still able to connect the pool size and the smart algorithm of the spare pool.
20. You can decide when the connection is felt to be 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. Agree to a connection that does not time out for a very long time. 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 the information of the report. 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

25 Benefits 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.