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

No transaction started after writing an empty chunk

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.0.1.CR1
    • 1.0.0.Final, 1.0.1.Beta
    • jberet-core
    • None

      When processing of all items in a chunk fails (processor returns null), the transaction is closed at the end of the chunk, but no new transaction is started, causing the next chunk to fail.

      Our input contains quite a few invalid records, and with the default item-count of 10, it can happen that all 10 items of a chunk are invalid. This empty chunk is not written (the writer is not called), but the transaction is comitted and the hibernate session is closed. The next chunk is started without opening a transaction first. We use @TransactionAttribute(TransactionAttributeType.MANDATORY) on all DAOs, and with no transaction active, it fails with an exception. For now, we've managed to work around it by setting the item-count to 100, making it very unlikely that none of the items in a chunk can be processed, but this is not a very elegant solution.

            cfang@redhat.com Cheng Fang
            papegaaij Emond Papegaaij
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: