“连接与托管连接无关”更改MySQL的JDBC驱动程序后

时间:2014-10-31 16:09:35

标签: java mysql jboss6.x

我在jboos 6.0.1上运行了一个webapp。

将MySQL的JDBC驱动程序从5.1.10更改为5.1.33后,我有时会遇到以下异常:

javax.ejb.EJBTransactionRolledbackException: Cannot open connection
        at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.handleInCallerTx(CMTTxInterceptor.java:148) [:0.0.2]
        at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:227) [:0.0.2]
        at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:353) [:0.0.2]
        at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:209) [:0.0.2]
            .
            .
            .
Caused by: java.sql.SQLException: Connection is not associated with a managed connection.org.jboss.resource.adapter.jdbc.jdk6.WrappedConnectionJDK6@1841c24c
        at org.jboss.resource.adapter.jdbc.WrappedConnection.lock(WrappedConnection.java:90)
        at org.jboss.resource.adapter.jdbc.WrappedStatement.lock(WrappedStatement.java:64)
        at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.setClob(WrappedPreparedStatement.java:802)
        at org.hibernate.type.descriptor.sql.ClobTypeDescriptor$2$1.doBind(ClobTypeDescriptor.java:70)
        at org.hibernate.type.descriptor.sql.ClobTypeDescriptor$1$1.doBind(ClobTypeDescriptor.java:56)
        at org.hibernate.type.descriptor.sql.BasicBinder.bind(Basic

似乎在版本5.1.13和5.1.14之间对驱动程序进行的修改导致了问题。 (可能是因为驱动程序渗透而没有发生的旧错误=)

1 个答案:

答案 0 :(得分:0)

我使用了这个JVM参数-Dhibernate.jdbc.use_streams_for_binary = true,它现在可以使用了!