enabling affects performance, but does not enable it. If an abnormal connection occurs, it may not be reclaimed in time, causing the system thread to be occupied and then hung up. For example, https://blog.csdn.net/lx34832.
enabling affects performance, but does not enable it. If an abnormal connection occurs, it may not be reclaimed in time, causing the system thread to be occupied and then hung up. For example, https://blog.csdn.net/lx34832.
Hello, it is generally not open in the production environment.
In the case ofTestOnBorrow=false, because the availability of connections in the pool is not tested, if the connections in the connection pool are closed by the database, the application may obtain these unavailable connections through the connection pool getConnection, and if these connections are not reclaimed by other threads, they will not be abolished or recreated, occupying the quota of the connection pool.
when TestOnBorrow=true, there are two situations:
1. When an instance in the cluster goes down, if the connection is not in the communication phase, the tcp connection is in the CLOSE_WAIT state or has been closed. When the application passes through the connection pool getConnection, it will detect the connection in the borrow. Because the connection has been closed, the following error is reported and a new connection is established, and the new connection is connected to other instances of the cluster. We can communicate normally in the back.
2. When an instance in the cluster goes down, if the connection happens to be in the communication stage, because the client cannot immediately perceive that the server has been disconnected, it may report the following error and wait for the response timeout from the server to report an error. When the application passes through the connection pool getConnection, the connection is detected during the borrow. Since the connection has been closed, the following error is reported and a new connection is re-established. At this time, the new connection is connected to other instances of the cluster. We can communicate normally in the back.
< hr >Previous: After putimagedata of canvas, the color value of rgba obtained by getimagedata is incorrect.
Next: Js global number failed?