I have studied the Websphere document "Connection Life Cycle" for Websphere Application Server Express v6.1 and and have searched the web for an answer to the following.
我已经为Websphere Application Server Express v6.1研究了Websphere文档“连接生命周期”,并在网上搜索了以下内容的答案。
Connection Pool State
连接池状态
- Pretest existing pooled connection is selected - retry interval is zero seconds
- Pretest new connections is selected - # of retries is zero and retry interval is 0
- Pretest SQL String is "Select 'Hello' from dual"
选择预测试现有池连接 - 重试间隔为零秒
选择预测试新连接 - 重试次数为零,重试间隔为0
预测试SQL字符串是“从双重选择'Hello'”
What happens if the pretest fails and
如果预测试失败了会发生什么
- There are no connections in the inFreePool or InUse state?
- There are connections in the inFreePool state?
inFreePool或InUse状态中没有连接?
inFreePool状态中有连接?
I'm referring to the settings in "Data sources > data_source > Websphere Application Server data source"
我指的是“数据源>数据源> Websphere Application Server数据源”中的设置
1 个解决方案
#1
application calls getConnection
应用程序调用getConnection
- If there is a connection inFreePool then it is tested using pretest SQL string and handed to the application if it passes the test.
- If it fails the test the pool is purged according to the Purge policy.
- If the purge policy is EntirePool then the entire free pool is purged and a new connection is acquired and tested.
- If purge policy is failingConnectionOnly then the failing connection is discarded and another connection is obtained from the pool and tested.
- If there are no connections in the pool then a new connection is created and tested. If the new connection fails then an exception (Type?) is thrown.
如果清除策略是EntirePool,则清除整个空闲池并获取并测试新连接。
如果清除策略为failingConnectionOnly,则丢弃失败的连接,并从池中获取另一个连接并进行测试。
如果池中没有连接,则创建并测试新连接。如果新连接失败,则抛出异常(Type?)。
如果测试失败,则根据清除策略清除池。如果清除策略是EntirePool,则清除整个空闲池并获取并测试新连接。如果清除策略为failingConnectionOnly,则丢弃失败的连接,并从池中获取另一个连接并进行测试。如果池中没有连接,则创建并测试新连接。如果新连接失败,则抛出异常(Type?)。
- If it fails the test the pool is purged according to the Purge policy.
- If there are no connections in the free pool then a new connection is created, tested and handed to the application if it passes the test. If the new connection fails then an exception is thrown.
如果在freePool中存在连接,则使用pretest SQL字符串对其进行测试,如果通过测试则将其传递给应用程序。如果测试失败,则根据清除策略清除池。如果清除策略是EntirePool,则清除整个空闲池并获取并测试新连接。如果清除策略为failingConnectionOnly,则丢弃失败的连接,并从池中获取另一个连接并进行测试。如果池中没有连接,则创建并测试新连接。如果新连接失败,则抛出异常(Type?)。
如果空闲池中没有连接,则创建新连接,测试并在通过测试时将其传递给应用程序。如果新连接失败,则抛出异常。
#1
application calls getConnection
应用程序调用getConnection
- If there is a connection inFreePool then it is tested using pretest SQL string and handed to the application if it passes the test.
- If it fails the test the pool is purged according to the Purge policy.
- If the purge policy is EntirePool then the entire free pool is purged and a new connection is acquired and tested.
- If purge policy is failingConnectionOnly then the failing connection is discarded and another connection is obtained from the pool and tested.
- If there are no connections in the pool then a new connection is created and tested. If the new connection fails then an exception (Type?) is thrown.
如果清除策略是EntirePool,则清除整个空闲池并获取并测试新连接。
如果清除策略为failingConnectionOnly,则丢弃失败的连接,并从池中获取另一个连接并进行测试。
如果池中没有连接,则创建并测试新连接。如果新连接失败,则抛出异常(Type?)。
如果测试失败,则根据清除策略清除池。如果清除策略是EntirePool,则清除整个空闲池并获取并测试新连接。如果清除策略为failingConnectionOnly,则丢弃失败的连接,并从池中获取另一个连接并进行测试。如果池中没有连接,则创建并测试新连接。如果新连接失败,则抛出异常(Type?)。
- If it fails the test the pool is purged according to the Purge policy.
- If there are no connections in the free pool then a new connection is created, tested and handed to the application if it passes the test. If the new connection fails then an exception is thrown.
如果在freePool中存在连接,则使用pretest SQL字符串对其进行测试,如果通过测试则将其传递给应用程序。如果测试失败,则根据清除策略清除池。如果清除策略是EntirePool,则清除整个空闲池并获取并测试新连接。如果清除策略为failingConnectionOnly,则丢弃失败的连接,并从池中获取另一个连接并进行测试。如果池中没有连接,则创建并测试新连接。如果新连接失败,则抛出异常(Type?)。
如果空闲池中没有连接,则创建新连接,测试并在通过测试时将其传递给应用程序。如果新连接失败,则抛出异常。