"IJ031017: You cannot set autocommit during a managed transaction" using Spring with EclipseLink in JBoss EAP

Solution Verified - Updated -

Issue

  • Using Spring JPATransactionManager with EclipseLink with JBoss managed JTA datasource
  • Encountering the error below

    ... java.sql.SQLException: IJ031017: You cannot set autocommit during a managed transaction
        at org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.setJdbcAutoCommit(BaseWrapperManagedConnection.java:973)
        at org.jboss.jca.adapters.jdbc.WrappedConnection.setAutoCommit(WrappedConnection.java:787)
        at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicBeginTransaction(DatabaseAccessor.java:238)
        ...
    

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 7
  • Spring / EclipseLink

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content