I'm hitting 'SQLException: You cannot set autocommit during a managed transaction!' while enabling hibernate.hbm2ddl.auto
Issue
-
Using Hibernate with CMT and 'hibernate.hbm2ddl.auto' set to update following SQLExcetion is raised at startup
2010-05-05 14:29:28,259 ERROR [org.hibernate.tool.hbm2ddl.SchemaUpdate] (EJB-Timer-1273062558598[target=jboss.j2ee:jar=....jar,name=Runner,service=EJB3]) could not complete schema update java.sql.SQLException: You cannot set autocommit during a managed transaction! at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.setJdbcAutoCommit(BaseWrapperManagedConnection.java:598) at org.jboss.resource.adapter.jdbc.WrappedConnection.setAutoCommit(WrappedConnection.java:459) at org.hibernate.tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.prepare(SuppliedConnectionProviderConnectionHelper.java:60) at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:168) at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:355) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1341)
Environment
-
Hibernate (all versions)
-
Container Managed Transaction (CMT)
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.