I have a webapp running on jboos 6.0.1.
After changing MySQL's JDBC Driver from 5.1.10 to 5.1.33 i'm getting sometimes the following Exception :
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
It seems that a modification made in the driver between the versions 5.1.13 and 5.1.14 caused the problem. ( it is may be and old bug that didn't happens because the driver was permessive =)
我使用了此JVM参数-Dhibernate.jdbc.use_streams_for_binary = true,现在可以正常使用!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.