Entry Point: proxoolfacade.
Startup sequence:
Proxooldriver-> proxoolfacade. registerconnectionpool->
Call Sequence
Proxooldriver. Connect-> connectionpoolmanager. getconnectionpool-> connectionpool. getconnection
-> Proxyconnection = prototyper. buildconnection-> proxyconnection. open ();
-> Proxyfactory. getwrappedconnection (proxyconnection)
-> Wrappedconnection
The proxy mode is used for subsequent calls.
Close link:
Wrappedconnection-> close-> proxyconnection. Close ()
-> Openstatements. Close-> connectionpool. removeproxy
Actually close the link:
Housekeeper-> connectionpool. removeproxyconnection-> compositeconnectionlistener. ondeath->
Connectionlistenerif. ondeath
Proxyconnection. reallyclose ();
Proxyconnections. Remove (proxyconnection );
----------------------------------
Connection Pool Design Principles:
1. When no request is sent, the connection pool is 0.
2. When there is a stable request, the connection can be reused to improve the performance.
3. When the connection pool suddenly breaks out, the connection pool capability is increased.
4. automatically reduces the connection pool capacity after peak hours.
5. After the connection starts the transaction, the link is exclusive and cannot be allocated.
Http://www.zhujiangroad.com/html/soft/s2928.html
Research and Design of JDBC-based database connection pool technology
. Connect to add a reference counter
. When a user accesses closeconnection, How many times does it determine the number of references? Yes, it will be deleted; judge whether to set the minimum number of connections? If it is smaller than the value, it will be put back; otherwise, it will be deleted.
. Each transaction exclusive a connection