Bug 4151 - spec questions on skippable exceptions: write, runtime exceptions, exclude
spec questions on skippable exceptions: write, runtime exceptions, exclude
Status: CLOSED WORKSFORME
Product: jbatch
Classification: Unclassified
Component: source
1
All All
: P5 minor
: ---
Assigned To: cvignola
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-26 15:48 UTC by ScottKurz
Modified: 2013-01-16 23:06 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ScottKurz 2012-09-26 15:48:02 UTC
Some questions on skippable exceptions (which basically apply to retryable, no-rollback exceptions too):

1) See my email to the issues mailing list w/ Subject 
"Interaction of SkipListener and chunked writes"

2) The language of the spec currently seems to allow for subjecting runtime exceptions to the skip (and retry) processing.    This could get tricky... if the runtime exception is coming from the batch container, then it might cause some complications if that can be caught and "skipped".    Could a runtime even end up in an inconsistent state somehow?

It seems one option would be to flat out disallow this in the spec wording (even though we can't easily express this in the method signature of read/write/process where we say "throws Exception").  OTOH, what if there is an API that throws a predictable runtime exception that the JSR352 developer would like to skip... it would be a bit odd to ask them to catch a RuntimeException just to throw a checked exception.     

I think the current language is fine, just wanted to make sure this issue was considered.

3) This one almost doesn't need to be asked:

If I have just an "exclude".. I'm not going to match anything, right?   We basically start with an implicit <exclude class="*"/>   (not that using a wildcard here is legal), so until you <include> something, <exclude> has no further affect.
Comment 1 cvignola 2012-10-05 20:40:13 UTC
I think there are no restrictions on which exceptions can be skipped or retried.  Even if they originated in the batch runtime.  Afterall, there is nothing stopping the application catching any and every exception and preventing the batch runtime from seeing those exceptions again.  

Yes, exclude qualifies include.