What is the situation of abandonedobjectpool is used?
Abandonedobjectpool is used (Org. Apache. commons. DBCP. abandonedobjectpool @ 7c12a1)
Logabandoned: false
Removeabandoned: True
Removeabandonedtimeout: 300
Remove removeabandoned = true from datasource configuration.
Details:
During configuration, the following parameters are hard to understand: removeabandoned, logabandoned, removeabandonedtimeout, and maxwait. If rmoveabandoned = true is set, the getnumactive () is about to reach getmaxactive () the system recycles invalid connections. The recovered connection is the connection that is not used after the number of seconds set in removeabandonedtimeout (300 seconds by default). Activating the recycle mechanism seems to be getnumactive () = getmaxactive ()-2. A little forgotten.
If logabandoned is set to true, the error message for recycling the connection will be printed in the log after the event is recycled, including where the connection is used but the connection is disabled, it is useful for debugging.
We recommend that you do not set the time for maxwait to be too long. If you set the time for maxwait to be too long, the client will wait for a long time to trigger the collection event.
The following is the properties file of my Configuration:
# Connection settings
JDBC. driverclassname = oracle. JDBC. Driver. oracledriver
JDBC. url = JDBC: oracle: thin: @ 127.0.0.1: 1521: dbserver
JDBC. Username = user
JDBC. Password = pass
# <! -- Initialize the connection -->
Datasource. initialsize = 10
# <! -- Maximum idle connection -->
Datasource. maxidle = 20
# <! -- Minimum idle connection -->
Datasource. minidle = 5
# Maximum number of connections
Datasource. maxactive = 50
# Whether to print the connection timeout error when the timeout connection is automatically recycled
Datasource. logabandoned = true
# Automatic Recovery of timeout connections
Datasource. removeabandoned = true
# Timeout (in seconds)
Datasource. removeabandonedtimeout = 180
# <! -- The timeout wait time is measured in milliseconds. The unit is 6000 milliseconds/1000 is equal to 60 seconds. -->
Datasource. maxwait = 1000 bytes failed to: http://blog.csdn.net/demon_chin/article/details/7998610