定期出现错误:
ERROR JDBCExceptionReporter --> javax.resource.ResourceException: IJ000453: 无法获取java:jboss/datasources/myDB的托管连接 08:12:05,928 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/mySoftware].[jsp]] (ajp--xx.255.0.yyy-8109-21) Servlet.service() for servlet jsp threw exception: javax.resource.ResourceException: IJ000655: 已超过配置的阻塞超时时间(30000[毫秒]),无可用的托管连接。 at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:377)等等。
因此,我在JBoss AS上有以下数据源配置:
<datasource jta="true" jndi-name="java:jboss/datasources/myDB" pool-name="ssbs-pssbs" enabled="true" use-ccm="true">
<connection-url>jdbc:postgresql://xx.255.0.yyy/myDatabase</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<driver>postgresql-jdbc4</driver>
<pool>
<min-pool-size>30</min-pool-size>
<max-pool-size>150</max-pool-size>
<prefill>true</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>tick</user-name>
<password>tack</password>
</security>
<validation>
<check-valid-connection-sql>SELECT 1</check-valid-connection-sql>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
</validation>
<timeout>
<blocking-timeout-millis>30000</blocking-timeout-millis>
<idle-timeout-minutes>5</idle-timeout-minutes>
</timeout>
<statement>
<share-prepared-statements>false</share-prepared-statements>
</statement>
</datasource>
在我的Postgres服务器中,我允许最大连接数为500。为什么会出现这个异常?