org.hibernate.TransactionException: JDBC rollback failed

Spring JIRA | David D. Kilzer | 1 decade ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Throwing a RuntimeException in a method in a proxied object before any database activity occurs causes a TransactionSystemException to be thrown when Spring attempts to roll back a transaction that hasn't started yet. Stack trace: org.springframework.transaction.TransactionSystemException: Could not roll back Hibernate transaction; nested exception is org.hibernate.TransactionException: JDBC rollback failed org.hibernate.TransactionException: JDBC rollback failed at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:150) at org.springframework.orm.hibernate3.HibernateTransactionManager.doRollback(HibernateTransactionManager.java:603) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:583) at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:560) at org.springframework.transaction.interceptor.TransactionAspectSupport.doCloseTransactionAfterThrowing(TransactionAspectSupport.java:285) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:100) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176) [...] Caused by: java.sql.SQLException: rollback() should not be called while in auto-commit mode. at net.sourceforge.jtds.jdbc.ConnectionJDBC2.rollback(ConnectionJDBC2.java:1989) at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcRollback(BaseWrapperManagedConnection.java:535) at org.jboss.resource.adapter.jdbc.WrappedConnection.rollback(WrappedConnection.java:460) at org.hibernate.transaction.JDBCTransaction.rollbackAndResetAutoCommit(JDBCTransaction.java:163) at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:142) ... 54 more In trying to reproduce this locally, it seems that the JBoss resource adapter may be the source of the problem because I can't get the problem to reproduce wihtout running it under JBoss. This code, if created within a proxied object, should have reproduced the error: @Transactional public void myTransactionalProxiedMethod() { throw new RuntimeException("No database access has occurred yet."); }

    Spring JIRA | 1 decade ago | David D. Kilzer
    org.hibernate.TransactionException: JDBC rollback failed
  2. 0

    Throwing a RuntimeException in a method in a proxied object before any database activity occurs causes a TransactionSystemException to be thrown when Spring attempts to roll back a transaction that hasn't started yet. Stack trace: org.springframework.transaction.TransactionSystemException: Could not roll back Hibernate transaction; nested exception is org.hibernate.TransactionException: JDBC rollback failed org.hibernate.TransactionException: JDBC rollback failed at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:150) at org.springframework.orm.hibernate3.HibernateTransactionManager.doRollback(HibernateTransactionManager.java:603) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:583) at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:560) at org.springframework.transaction.interceptor.TransactionAspectSupport.doCloseTransactionAfterThrowing(TransactionAspectSupport.java:285) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:100) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176) [...] Caused by: java.sql.SQLException: rollback() should not be called while in auto-commit mode. at net.sourceforge.jtds.jdbc.ConnectionJDBC2.rollback(ConnectionJDBC2.java:1989) at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcRollback(BaseWrapperManagedConnection.java:535) at org.jboss.resource.adapter.jdbc.WrappedConnection.rollback(WrappedConnection.java:460) at org.hibernate.transaction.JDBCTransaction.rollbackAndResetAutoCommit(JDBCTransaction.java:163) at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:142) ... 54 more In trying to reproduce this locally, it seems that the JBoss resource adapter may be the source of the problem because I can't get the problem to reproduce wihtout running it under JBoss. This code, if created within a proxied object, should have reproduced the error: @Transactional public void myTransactionalProxiedMethod() { throw new RuntimeException("No database access has occurred yet."); }

    Spring JIRA | 1 decade ago | David D. Kilzer
    org.hibernate.TransactionException: JDBC rollback failed
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Problemas com mapeamentos no hibernate - Javafree: O fórum de Java que mais cresce

    com.br | 1 year ago
    org.hibernate.TransactionException: JDBC rollback failed
  5. 0

    H2 Database - Rollback failure

    nabble.com | 1 year ago
    org.hibernate.TransactionException: JDBC rollback failed

    2 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.hibernate.TransactionException

      JDBC rollback failed

      at org.hibernate.transaction.JDBCTransaction.rollback()
    2. Hibernate
      JDBCTransaction.rollback
      1. org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:150)
      1 frame
    3. Hibernate
      HibernateTransactionManager.doRollback
      1. org.springframework.orm.hibernate3.HibernateTransactionManager.doRollback(HibernateTransactionManager.java:603)
      1 frame
    4. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:583)
      2. org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:560)
      3. org.springframework.transaction.interceptor.TransactionAspectSupport.doCloseTransactionAfterThrowing(TransactionAspectSupport.java:285)
      4. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:100)
      4 frames
    5. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
      2 frames