Uploaded image for project: 'JBeret'
  1. JBeret
  2. JBERET-182

No transaction for ItemReader::open and ItemWriter::open on rollback checkpoint

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.2.0.Beta1
    • 1.1.0.Final
    • jberet-core
    • None

      Unlike ChunkRunner::run

      there is currently no transaction created on rollback checkpoint in ChunkRunner::rollbackCheckpoint

      This results in an exception during rollback checkpoint when performing operations inside one of the open() methods that require a transaction to be present.

      Replacing lines 621-630 with the following fixes the issue for me.

      tm.begin();
      try {         
            itemReader.open(stepOrPartitionExecution.getReaderCheckpointInfo());
            processingInfo.readPosition = processingInfo.checkpointPosition;          
            itemWriter.open(stepOrPartitionExecution.getWriterCheckpointInfo());
            tm.commit();
      } catch (Exception e) {
            tm.rollback();
            // An error occurred, safely close the reader and writer
            safeClose();
            throw e;
      }
      

              cfang@redhat.com Cheng Fang
              moritz.becker@gmx.at Moritz Becker (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: