在网上可以搜到不少关于weblogic自动重连数据库的文章,需要设置一些参数。其中提到了RefreshMinutes这个参数,在8和9版本中我都没找到这个参数的踪影。经过分析,估计跟如下的参数时一个意思。
Test Frequency:
The number of seconds (between 0 and a positive 32-bit integer) between automatic database connection tests. Connections that fail the test are closed and reopened to re-establish a valid physical database connection. (You must specify a Test Table Name below.)
抱着求甚解的态度,去翻阅了weblogic6,7版本的帮助文档,均没找到Test Frequency这个参数,不过都有一个跟RefreshMinutes类似的参数描述:
Shrink Period
我们来看一下在6,7版本中对该参数的解释
6
Refresh Period
This attribute sets the connection refresh interval. Every unused connection will be tested using TestTableName. Connections that do not pass the test will be closed and reopened in an attempt to reestablish a valid physical database connection. If TestTableName is not set then the test will not be performed.
Integer. Units in minutes.
Minimum = 0.
Maximum = 35791394
Default = 0.
7
Refresh Period
The number of minutes between database connection tests. After every RefreshMinutes interval, unused database connections are tested using TestTableName. Connections that do not pass the test will be closed and reopened to re-establish a valid physical database connection. If TestTableNameis not set, the test will not be performed.
MBean: weblogic.management.
configuration.
JDBCConnectionPoolMBean
Attribute: RefreshMinutes
Units: minutes
Minimum: 0
Maximum: 35791394
Default: 0
Configurable: yes
Readable: yes
Writable: yes
总结:很明显,在weblogic7中指明了这个RefreshMinutes参数,从参数解释来看,在8,9版本里的Test Frequency似乎跟RefreshMinutes是一个意思。
参考链接:
http://download.oracle.com/docs/cd/E13222_01/wls/docs61/ConsoleHelp/
http://download.oracle.com/docs/cd/E13222_01/wls/docs70/ConsoleHelp