-
Jun 19th, 2009, 01:39 PM
#1
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.
-
Jun 20th, 2009, 04:04 PM
#2
-
Jun 21st, 2009, 08:18 AM
#3
I tried and din't work. I could also understand skiplistener is not for skipped exceptions instead for skipped lines or items.
-
Jun 21st, 2009, 08:26 AM
#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.
-
Jun 21st, 2009, 02:02 PM
#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>
-
Oct 6th, 2009, 12:01 PM
#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
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules