1. 程式人生 > >weblogic的connection pool斷開後自動連線

weblogic的connection pool斷開後自動連線

1.weblogic 建立connection pool後經常會斷開,無法自動連線.
需要進入weblogic console  ,選擇Connection Pools,選擇相應的連線池名
進入後,點選Configuration->"Connections" tab標籤. 點開Advanced Options後的Show
勾選上:Test Reserved Connections,Test Created Connections,Test Released Connections
使用時選擇在Test Table Name中輸入測試表名.

2.
連線池配置資料庫斷掉後自動重連
進入某個連線池配置頁,進入“連線“頁,點選高階選項的”show“顯示高階選項。
指定 "測試頻率" 並啟用 "測試保留的連線"、"測試建立的連線" 和 "測試釋放的連線"。
 
測試頻率(Test Frequency):  60 秒
自動資料庫連線測試之間的秒數(0 - 32 位正整數)。測試失敗的連線將被關閉,然後重新開啟以重新建立有效的物理資料庫連線。(必須在下面指定測試表名稱。)
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.)
 
測試保留的連線(Test Reserved Connections)
指定 WebLogic Server 是否在將連線提供給客戶端之前測試該連線。(必須在下面指定測試表名稱。)
Specifies whether WebLogic Server tests a connection before giving it to the client. (You must specify a Test Table Name below.) 
 
測試建立的連線(Test Created Connections)
指定 WebLogic Server 是否在建立連線後且將該連線新增到緩衝池中可用連線列表之前對該連線進行測試。(必須指定測試表名稱。) 
Specifies whether WebLogic Server tests a connection after creating it but before adding it to the list of connections available in the pool. (You must specify a Test Table Name.)
 
測試釋放的連線(Test Released Connections)
指定 WebLogic Server 是否在將連線返回到該 JDBC 連線緩衝池之前測試該連線。(必須指定測試表名稱。)
Specifies whether WebLogic Server tests a connection before returning it to this JDBC connection pool. (You must specify a Test Table Name.)
 
連線保留超時(Connection Reserve Timeout): 設為 30 秒
在保留緩衝池連線的呼叫超時之前的秒數(-1 - 32 位正整數)。如果設定為 -1,則呼叫永遠不會超時。
The number of seconds (between -1 and a positive 32-bit integer) after which a call to reserve a connection from the pool will timeout. When set to 0, a call will never timeout. When set to -1, a call will timeout immediately
 
重試建立連線的頻率(Connection Creation Retry Frequency): 設為 30 秒 嘗試建立與資料庫的連線的間隔秒數(0 - 32 位正整數)。適用於在資料庫不可用的情況下伺服器啟動時建立的連線緩衝池。 
The number of seconds (between 0 and a positive 32-bit integer) between attempts to establish connections to the database. Applies to connection pools created at server startup when the database is unavailable.
 
鈍化連線超時(Inactive Connection Timeout):
The number of inactive seconds on a reserved connection (between 0 and a positive 32-bit integer) before WebLogic Server reclaims the connection and releases it back into the connection pool.
伺服器申請複議連線並且保留返回給連線池前的鈍化時間
 
測試表名稱(Test Table Name):  
oracle的連線池預設為 SQL SELECT 1 FROM DUAL,sybase資料庫可以填入一個記錄不多的配置表名例如sys_code。
The name of the database table to use when testing physical database connections. This field is required when you specify a Test Frequency and enable Test Reserved Connections, Test Created Connections, and Test