JBOSS AS 7.1.1。最终关闭泄漏连接? [英] JBOSS AS 7.1.1.Final Closing Leaked Connections?

查看:1211
本文介绍了JBOSS AS 7.1.1。最终关闭泄漏连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在standalone.xml中做了以下设置:

I have already done the following settings in standalone.xml as:

<datasource jta="true" jndi-name="java:jboss/datasources/myDS" pool-name="java:jboss/datasources/myDS" enabled="true" use-ccm="true">
<cached-connection-manager debug="true" error="true"/>

因此,我还收到类似为您关闭连接的消息:

Therefore, I am also getting the messages like "Closing a connection for you" as:

INFO  [org.jboss.jca.core.api.connectionmanager.ccm.CachedConnectionManager] (http--0.0.0.0-8080-160) IJ000100: Closing a connection for you. Please close them yourself: org.jboss.jca.adapters.jdbc.jdk6.WrappedConnectionJDK6@5cdb81dc: java.lang.Throwable: STACKTRACE
    at org.jboss.jca.core.connectionmanager.ccm.CachedConnectionManagerImpl.registerConnection(CachedConnectionManagerImpl.java:265)
    at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:495)
    at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:129)

然而,有时候我的游泳池会耗尽。它超出所定义的200个连接。为什么?

Still, Sometimes my pool gets exhausted. It runs out of connections beyond 200 as defined. Why?

<min-pool-size>30</min-pool-size>
<max-pool-size>200</max-pool-size>

没有办法,我的应用程序需要这些连接。
肯定有连接泄漏。如果是,为什么jboss没有关闭它是它自己的,当我启用了如上所述的设置:

There is no way, that my application needs these much connections. There is surely a connection leakage. And If it is, Why jboss is not closing it by it's own when I have enabled the setting as i said above:

<datasource jta="true" jndi-name="java:jboss/datasources/myDS" pool-name="java:jboss/datasources/myDS" enabled="true" use-ccm="true">
<cached-connection-manager debug="true" error="true"/>

如何解决?

推荐答案

JBoss无法关闭所有泄漏的连接。

JBoss can not close all leaked connection.

在启用JCA日志记录后通过检查日志来查找泄漏的连接。我以这种方式解决了连接泄漏。

You need to find leaked connection by checking logs after enabling JCA logging. I resolved connection leak by this way.

<logger category="org.jboss.jca">
                <level name="DEBUG"/>
</logger>

您将在日志中收到以下条目

You will get entries like below in logs

DEBUG [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool](MSC服务线程1-4){JNDI_NAME}:getConnection(null,null)[1/100] - > 这意味着从池连接。

DEBUG [org.jboss .jca.core.connectionmanager.pool.strategy.OnePool](MSC service thread 1-4){JNDI_NAME}:returnConnection(607e334,false)[1/99] - > 意味着返回连接到池

您可以检查哪个查询未将连接返回到池,并从执行查询的位置检查应用程序。修复它。

You can check which query is not returning connetion to pool and check your application from where that query is being executed. Fix it.

这篇关于JBOSS AS 7.1.1。最终关闭泄漏连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆