Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-962

Unexpected errors and warnings in batch-processing QS

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 7.0.0.DR10
    • 7.0.0.DR9
    • Quickstarts
    • None

      In "Usage 2: Import an error file and fix it" after generating a new file with duplicate records and starting import job, these messages are logged in server log:

      10:31:49,788 WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (Batch Thread - 2) SQL Error: 23505, SQLState: 23505
      10:31:49,789 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (Batch Thread - 2) Unique index or primary key violation: "UK_5262X47R5J8LUNRR9TUFC5UO8_INDEX_6 ON PUBLIC.CONTACT(NAME) VALUES ( /* key:5 */ 6, 'Lkrdzvphkr', '(332)-014-806')"; SQL statement:
      insert into Contact (name, phone, id) values (?, ?, ?) [23505-173]
      10:31:49,790 INFO  [org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl] (Batch Thread - 2) HHH000010: On release of batch it still contained JDBC statements
      10:31:49,791 INFO  [org.jboss.as.quickstarts.batch.job.listener.PersistListener] (Batch Thread - 2) Exception detected. Setting exit status
      10:31:49,794 ERROR [org.jberet] (Batch Thread - 2) ProcessingInfo{count=3, timerExpired=false, itemState=RUNNING, chunkState=RUNNING, checkpointPosition=2, readPosition=5, failurePoint=null}
      10:31:49,794 ERROR [org.jberet] (Batch Thread - 2) item-count=3, time-limit=0, skip-limit=-1, skipCount=0, retry-limit=-1, retryCount=0
      10:31:49,794 ERROR [org.jberet] (Batch Thread - 2) JBERET000007: Failed to run job import-file, import-file-chunk, org.jberet.job.model.Chunk@2e37832d: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement
      	at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1692)
      	at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1602)
      	at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1608)
      	at org.hibernate.jpa.spi.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:1303)
      	at org.jboss.as.jpa.container.AbstractEntityManager.flush(AbstractEntityManager.java:459)
      	at org.jboss.as.quickstarts.batch.job.ContactsPersister.writeItems(ContactsPersister.java:57)
      	at org.jberet.runtime.runner.ChunkRunner.doCheckpoint(ChunkRunner.java:516)
      	at org.jberet.runtime.runner.ChunkRunner.readProcessWriteItems(ChunkRunner.java:311)
      	at org.jberet.runtime.runner.ChunkRunner.run(ChunkRunner.java:195)
      	at org.jberet.runtime.runner.StepExecutionRunner.runBatchletOrChunk(StepExecutionRunner.java:219)
      	at org.jberet.runtime.runner.StepExecutionRunner.run(StepExecutionRunner.java:140)
      	at org.jberet.runtime.runner.CompositeExecutionRunner.runStep(CompositeExecutionRunner.java:164)
      	at org.jberet.runtime.runner.CompositeExecutionRunner.runFromHeadOrRestartPoint(CompositeExecutionRunner.java:88)
      	at org.jberet.runtime.runner.JobExecutionRunner.run(JobExecutionRunner.java:56)
      	at org.wildfly.jberet.services.BatchEnvironmentService$WildFlyBatchEnvironment$1.run(BatchEnvironmentService.java:169)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      	at org.jboss.threads.JBossThread.run(JBossThread.java:320)
      Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement
      	at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:112)
      	at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
      	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109)
      	at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:95)
      	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:207)
      	at org.hibernate.engine.jdbc.batch.internal.NonBatchingBatch.addToBatch(NonBatchingBatch.java:45)
      	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2823)
      	at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3323)
      	at org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:89)
      	at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:447)
      	at org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:333)
      	at org.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:335)
      	at org.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:39)
      	at org.hibernate.internal.SessionImpl.flush(SessionImpl.java:1224)
      	at org.hibernate.jpa.spi.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:1300)
      	... 17 more
      Caused by: org.h2.jdbc.JdbcSQLException: Unique index or primary key violation: "UK_5262X47R5J8LUNRR9TUFC5UO8_INDEX_6 ON PUBLIC.CONTACT(NAME) VALUES ( /* key:5 */ 6, 'Lkrdzvphkr', '(332)-014-806')"; SQL statement:
      insert into Contact (name, phone, id) values (?, ?, ?) [23505-173]
      	at org.h2.message.DbException.getJdbcSQLException(DbException.java:331)
      	at org.h2.message.DbException.get(DbException.java:171)
      	at org.h2.message.DbException.get(DbException.java:148)
      	at org.h2.index.BaseIndex.getDuplicateKeyException(BaseIndex.java:101)
      	at org.h2.index.TreeIndex.add(TreeIndex.java:68)
      	at org.h2.table.RegularTable.addRow(RegularTable.java:125)
      	at org.h2.command.dml.Insert.insertRows(Insert.java:127)
      	at org.h2.command.dml.Insert.update(Insert.java:86)
      	at org.h2.command.CommandContainer.update(CommandContainer.java:79)
      	at org.h2.command.Command.executeUpdate(Command.java:235)
      	at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:154)
      	at org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:140)
      	at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:537)
      	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:204)
      	... 27 more
      

      See the attached server log for more details.

        1. server.log
          70 kB
          Nikoleta Ziakova

              sgilda_jira Sande Gilda (Inactive)
              nziakova@redhat.com Nikoleta Ziakova (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: