[請教] 使用容器管理的EntityBean時產生的資料庫連線沒有關閉的異常

mm_hotsky發表於2005-03-09
J2EE容器是WEBLOGIC
會話Bean和實體Bean兩者均是本地的並且也都是容器管理的,會話Bean中有一個方法A()
呼叫實體Bean定義在Home介面中的方法B(),B()方法再呼叫實體Bean的一個ejbSelect()方法。
這個ejbSelect()方法跨越多個表查詢,例如:
select a.cmp1, a.cmp2, a.cmr.cmp1, a.cmr.cmr.cmp1 from entity a

這樣做倒是能完成所需要的功能,但是WEBLOGIC的控制檯上報出異常,不知道為什麼。程式碼如下:
<2005-3-9 下午01時33分50秒 CST> <Warning> <JDBC> <BEA-001074> <A JDBC pool connection leak was detected. A connection leak occurs when a connection obtained from the pool was not closed explicitly by calling close() and then was disposed by the garbage collector and returned to the connection pool. The following stack trace at create shows where the leaked connection was created. [Null exception passed, creating stack trace for offending caller]

相關文章