Websphere Application Server 6.1连接池问题 - 当AS无法获得连接时会发生什么

时间:2021-07-08 15:19:40

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

连接池状态

  1. Pretest existing pooled connection is selected - retry interval is zero seconds
  2. 选择预测试现有池连接 - 重试间隔为零秒

  3. Pretest new connections is selected - # of retries is zero and retry interval is 0
  4. 选择预测试新连接 - 重试次数为零,重试间隔为0

  5. Pretest SQL String is "Select 'Hello' from dual"
  6. 预测试SQL字符串是“从双重选择'Hello'”

What happens if the pretest fails and

如果预测试失败了会发生什么

  1. There are no connections in the inFreePool or InUse state?
  2. inFreePool或InUse状态中没有连接?

  3. There are connections in the inFreePool state?
  4. 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

  1. If there is a connection inFreePool then it is tested using pretest SQL string and handed to the application if it passes the test.
    1. If it fails the test the pool is purged according to the Purge policy.
      1. If the purge policy is EntirePool then the entire free pool is purged and a new connection is acquired and tested.
      2. 如果清除策略是EntirePool,则清除整个空闲池并获取并测试新连接。

      3. If purge policy is failingConnectionOnly then the failing connection is discarded and another connection is obtained from the pool and tested.
      4. 如果清除策略为failingConnectionOnly,则丢弃失败的连接,并从池中获取另一个连接并进行测试。

      5. 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.
      6. 如果池中没有连接,则创建并测试新连接。如果新连接失败,则抛出异常(Type?)。

    2. 如果测试失败,则根据清除策略清除池。如果清除策略是EntirePool,则清除整个空闲池并获取并测试新连接。如果清除策略为failingConnectionOnly,则丢弃失败的连接,并从池中获取另一个连接并进行测试。如果池中没有连接,则创建并测试新连接。如果新连接失败,则抛出异常(Type?)。

  2. 如果在freePool中存在连接,则使用pretest SQL字符串对其进行测试,如果通过测试则将其传递给应用程序。如果测试失败,则根据清除策略清除池。如果清除策略是EntirePool,则清除整个空闲池并获取并测试新连接。如果清除策略为failingConnectionOnly,则丢弃失败的连接,并从池中获取另一个连接并进行测试。如果池中没有连接,则创建并测试新连接。如果新连接失败,则抛出异常(Type?)。

  3. 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.
  4. 如果空闲池中没有连接,则创建新连接,测试并在通过测试时将其传递给应用程序。如果新连接失败,则抛出异常。

#1


application calls getConnection

应用程序调用getConnection

  1. If there is a connection inFreePool then it is tested using pretest SQL string and handed to the application if it passes the test.
    1. If it fails the test the pool is purged according to the Purge policy.
      1. If the purge policy is EntirePool then the entire free pool is purged and a new connection is acquired and tested.
      2. 如果清除策略是EntirePool,则清除整个空闲池并获取并测试新连接。

      3. If purge policy is failingConnectionOnly then the failing connection is discarded and another connection is obtained from the pool and tested.
      4. 如果清除策略为failingConnectionOnly,则丢弃失败的连接,并从池中获取另一个连接并进行测试。

      5. 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.
      6. 如果池中没有连接,则创建并测试新连接。如果新连接失败,则抛出异常(Type?)。

    2. 如果测试失败,则根据清除策略清除池。如果清除策略是EntirePool,则清除整个空闲池并获取并测试新连接。如果清除策略为failingConnectionOnly,则丢弃失败的连接,并从池中获取另一个连接并进行测试。如果池中没有连接,则创建并测试新连接。如果新连接失败,则抛出异常(Type?)。

  2. 如果在freePool中存在连接,则使用pretest SQL字符串对其进行测试,如果通过测试则将其传递给应用程序。如果测试失败,则根据清除策略清除池。如果清除策略是EntirePool,则清除整个空闲池并获取并测试新连接。如果清除策略为failingConnectionOnly,则丢弃失败的连接,并从池中获取另一个连接并进行测试。如果池中没有连接,则创建并测试新连接。如果新连接失败,则抛出异常(Type?)。

  3. 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.
  4. 如果空闲池中没有连接,则创建新连接,测试并在通过测试时将其传递给应用程序。如果新连接失败,则抛出异常。