Closed Connection:java.sql.SQLRecoverableException:Closed Connection jboss 7

时间:2013-12-05 08:52:30

标签: java performance jboss7.x ibatis

从数据库中获取CLOB时,我们面临异常。

Closed Connection: java.sql.SQLRecoverableException: Closed Connection
        at oracle.sql.CLOB.getDBAccess(CLOB.java:1510) [ojdbc6.jar:11.2.0.3.0]
        at oracle.sql.CLOB.getCharacterStream(CLOB.java:361) [ojdbc6.jar:11.2.0.3.0]

我们只是从数据库中获取此异常,这实际上是非常随机的。

对于oracle 11.2.0.3和ironjacamar-jdbc-1.0.9.final.jar,我们正在使用jboss7.0.2和ojdbc6.jar

standalone.xml配置如下

<driver>
  ojdbc6
</driver>
<pool>
  <max-pool-size>
    25
  </max-pool-size>
  <prefill>
    false
  </prefill>
  <use-strict-min>
    false
  </use-strict-min>
  <flush-strategy>
    FailingConnectionOnly
  </flush-strategy>
 </pool>
 <security>
   <security-domain>
     TestDSRealm
   </security-domain>
 </security>
 <validation>
   <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"/>
   <validate-on-match>
     false
   </validate-on-match>
   <background-validation>
     false
   </background-validation>
   <use-fast-fail>
     false
   </use-fast-fail>
   <stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker"/>
   <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"/>
   </validation>
   <statement>
    <prepared-statement-cache-size>
                                100
    </prepared-statement-cache-size>
   </statement>

我们在这里做错了吗?有什么想法吗?

感谢您的帮助..

谢谢,

1 个答案:

答案 0 :(得分:1)

我将映射从Clob更改为String(Loading Clob data as a String (eager) via Hibernate's org.hibernate.Query),然后完成了工作。