jboss 数据库连接管理的一个问题

工作中遇到了一个问题,google了一篇,

原文地址:http://blog.csdn.net/xumiao19871129/archive/2009/10/14/4669898.aspx

转载如下:

 

1

[CachedConnectionManager] Closing a connection for you.  Please close them yourself: org.jboss.resource.adapter.jdbc.jdk5.WrappedConnectionJDK5@c75442
java.lang.Throwable: STACKTRACE
 at org.jboss.resource.connectionmanager.CachedConnectionManager.registerConnection(CachedConnectionManager.java:290)
 at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:423)
 at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:849)
 at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)
 at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69)
 at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
 at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
 at org.hibernate.jdbc.BorrowedConnectionProxy.invoke(BorrowedConnectionProxy.java:50)
 at $Proxy407.createStatement(Unknown Source)
 at com.eway.businessservice.util.DataUtil.queryListAsHashMap(DataUtil.java:14)
 at com.eway.persistence.dao.DepartmentDAO.findAllChildren(DepartmentDAO.java:425)
 at com.eway.businessservice.department.ejb.DepartmentManager.findAllChildren(DepartmentManager.java:358)

2

Connection is not associated with a managed connection.org.jboss.resource.adapter.jdbc.jdk5.WrappedConnectionJDK5@17240d9

jboss自动关闭数据连接,有时会出再如上异常,连接未关闭,解决办法

1,手动关闭每一个连接

2.首先把 D:/jboss/server/default/deploy/jboss-web.deployer/server.xml 里的

                  cachedConnectionManagerObjectName="jboss.jca:service=CachedConnectionManager"
                transactionManagerObjectName="jboss:service=TransactionManager" />

  注释去掉

然后

 http://forums.sun.com/thread.jspa?threadID=737400   

   

   If you are using Hibernate, it is recommended to add a "hibernate.connection.release_mode" property on value "auto" (the default) in your hibernate.cfg.xml file.

This did not work for me. So I found the following workaround:
To remove the message you need to set the "Debug" property to "false" in the CachedConnectionManager mbean configuration, in the jbossjca-service.xml file, for example:
 


    jboss:service=TransactionManager
    false
 

 

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/xumiao19871129/archive/2009/10/14/4669898.aspx

你可能感兴趣的:(其他)