Announcement Announcement Module
Collapse
No announcement yet.
skippable-exceptions Listeners Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • skippable-exceptions Listeners

    <j:step id="processIPFile" next="moveProcessedFile" >
    <j:tasklet allow-start-if-complete="true">
    <j:chunk reader="orderRecordReader"
    writer="orderRecordWriter"
    commit-interval="1"
    skip-limit="1000000">
    <j:skippable-exception-classes >
    org.hibernate.exception.ConstraintViolationExcepti on
    </j:skippable-exception-classes>
    </j:chunk>
    <j:no-rollback-exception-classes >
    org.hibernate.exception.ConstraintViolationExcepti on
    </j:no-rollback-exception-classes>
    <j:listeners>
    <j:listener ref="orderLoadStepListener" />
    </j:listeners>
    </j:tasklet>
    </j:step>

    I want to have a listener, such that it is notified on the above skippable-exceptions.

  • #2
    Use SkipListener?

    Comment


    • #3
      I tried and din't work. I could also understand skiplistener is not for skipped exceptions instead for skipped lines or items.

      Comment


      • #4
        What do you mean by "didn't work"? Did you get an exception? Was it just not called?

        I'm confused by what you mean by "not for skipped exceptions". An exception is thrown to skip a line. If a line is skipped, then the listener will be called.

        Comment


        • #5
          Yes got an exception and it is ignored , process continued with the following item, but the listener is not notified.

          Configuration fragment follows:

          <j:step id="processIPFile" next="moveProcessedFile" >
          <j:tasklet allow-start-if-complete="true">
          <j:chunk reader="orderRecordReader" writer="orderRecordWriter" commit- interval="${orderload.ipfile.commitinterval}" skip-limit="1000000">
          <j:skippable-exception-classes > org.springframework.dao.DataIntegrityViolationExce ption,org.hibernate.exception.ConstraintViolationE xception
          </j:skippable-exception-classes>
          </j:chunk>
          <j:no-rollback-exception-classes >
          org.springframework.dao.DataIntegrityViolationExce ption,org.hibernate.exception.ConstraintViolationE xception
          </j:no-rollback-exception-classes>
          <j:listeners>
          <j:listener ref="orderLoadStepListener" />
          <j:listener ref="skipListener" />
          </j:listeners>
          </j:tasklet>
          </j:step>

          Comment


          • #6
            For what its worth, I've experienced the same thing. Skip listener is never notified of exceptions during writes with it encounters:

            org.hibernate.exception.ConstraintViolationExcepti on

            Thanks,

            Alejandro

            Comment

            Working...
            X