troubleshooting Question

Hibernate: JDBCTransaction toggleAutoCommit Could not toggle autocommit

Avatar of jaggernat
jaggernat asked on
16 Comments1 Solution16188 ViewsLast Modified:
hi guys

when i use this code

                Session session = HibernateUtil.getSessionFactory().getCurrentSession();      
            try {

                //code to call store proc

            catch(Exception e)


i get this exception

org.hibernate.transaction.JDBCTransaction toggleAutoCommit Could not toggle autocommit
                  java.sql.SQLException: DSRA9350E: Operation setAutoCommit is not allowed during a global transaction.
      at org.hibernate.transaction.JDBCTransaction.toggleAutoCommit(
      at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(
      at org.hibernate.transaction.JDBCTransaction.commit(
      at com.aoc.judiciary.framework.daoImpl.TestDaoImpl.getInfo(
      at com.aoc.judiciary.framework.ejb.BeantestingBean.retrieveInfo(
      at com.aoc.judiciary.framework.ejb.EJSLocalStatelessBeantesting_f63227a0.retrieveInfo(
      at com.aoc.judiciary.framework.delegateImpl.LocalTestDelegateImpl.retrieveInfo(
      at com.aoc.judiciary.framework.ActionClasses.Action1.retrieve(
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

and intrestingly when i dont write the  "session.getTransaction().commit() "  statement , there are no exceptions on console.

any one encountered this situation in their project?


Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 16 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 16 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros