1 Reply Latest reply on May 12, 2006 12:35 PM by Vivek Srivastav

    Error: Could not execute JDBC batch update NonSpecificExcept

    Vivek Srivastav Newbie

      Hi,
      When I deploy my application into JBoss and access the EJB to merge some EJB entity beans, I am getting the following exception with 4.0.4.CR2.

      Runtime exception in the org.jboss.ejb3.tx.Ejb3TxPolicy.invokeInOurTx
      message: JBossRollbackException unable to commit transaction.

      When I start the JBoss server (on a fresh installation choosing in ejb3 configuration), I get the following message about TransactionManager:

      11:06:05,328 WARN [EJBTimerServiceImpl] Cannot obtain TransactionManager from JNDI, using TxManager.getInstance(): javax.naming.NameNotFoundException: TransactionManager not bound

      I am not sure if there is some problem with the installer

      Following is the detailed exception trace that I see:

      org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
       at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
       at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
       at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:249)
       at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235)
       at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:142)
       at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:297)
       at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
       at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:988)
       at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:337)
       at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:473)
       at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1488)
       at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java:1107)
       at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:321)
       at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:175)
       at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87)
       at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:192)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:54)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.aspects.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:167)
       at org.jboss.ejb3.security.RoleBasedAuthorizationInterceptor.invoke(RoleBasedAuthorizationInterceptor.java:100)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:225)
       at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:55)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
       at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102)
       at $Proxy81.updateElement(Unknown Source)
       at org.vss.mbean.CORViewService.scanHMSElement(CORViewService.java:237)
       at org.vss.mbean.CORViewService.scanElement(CORViewService.java:138)
       at org.vss.mbean.CORViewService$PollingThread.run(CORViewService.java:89)
      Caused by: java.sql.BatchUpdateException: failed batch
       at org.hsqldb.jdbc.jdbcStatement.executeBatch(Unknown Source)
       at org.hsqldb.jdbc.jdbcPreparedStatement.executeBatch(Unknown Source)
       at org.jboss.resource.adapter.jdbc.CachedPreparedStatement.executeBatch(CachedPreparedStatement.java:478)
       at org.jboss.resource.adapter.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:517)
       at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:58)
       at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242)
       ... 35 more
      


        • 1. Re: Error: Could not execute JDBC batch update NonSpecificEx
          Vivek Srivastav Newbie

          The Warning went away after adding the dependency in the ejb-timer-service.xml.

          I wm wondering if the following settings have anything to do with the JDBC batch update failure:

          12:29:13,203 INFO [SettingsFactory] Automatic flush during beforeCompletion(): disabled
          12:29:13,203 INFO [SettingsFactory] Automatic session close at end of transaction: disabled
          12:29:13,203 INFO [SettingsFactory] JDBC batch size: 15
          12:29:13,203 INFO [SettingsFactory] JDBC batch updates for versioned data: disabled
          12:29:13,203 INFO [SettingsFactory] Scrollable result sets: enabled
          12:29:13,203 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): disabled
          12:29:13,203 INFO [SettingsFactory] Connection release mode: auto
          12:29:13,203 INFO [SettingsFactory] Default batch fetch size: 1
          12:29:13,203 INFO [SettingsFactory] Generate SQL with comments: disabled
          12:29:13,203 INFO [SettingsFactory] Order SQL updates by primary key: disabled
          12:29:13,203 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
          12:29:13,203 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
          12:29:13,203 INFO [SettingsFactory] Query language substitutions: {}
          12:29:13,203 INFO [SettingsFactory] Second-level cache: enabled
          12:29:13,203 INFO [SettingsFactory] Query cache: disabled
          12:29:13,203 INFO [SettingsFactory] Cache provider: org.hibernate.cache.HashtableCacheProvider
          12:29:13,203 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
          12:29:13,203 INFO [SettingsFactory] Structured second-level cache entries: disabled
          12:29:13,203 INFO [SettingsFactory] Statistics: disabled
          12:29:13,203 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
          12:29:13,203 INFO [SettingsFactory] Default entity-mode: pojo