Issue Details (XML | Word | Printable)

Key: BATCH-350
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dave Syer
Reporter: Douglas C. Kaminsky
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Spring Batch

Remove close() method from non ItemStreams

Created: 10/Feb/08 05:44 PM   Updated: 07/Aug/08 10:06 AM
Component/s: None
Affects Version/s: 1.0.0.m4
Fix Version/s: 1.0.0.m5

Time Tracking:
Original Estimate: 0d
Remaining Estimate: 0d
Time Spent - 0.05d
Time Spent: 0.05d
Time Spent - 0.05d


 Description  « Hide
The following classes have a default close method implementation which does not belong and should be removed:

org.springframework.batch.execution.launch.EmptyItemWriter
org.springframework.batch.item.writer.ItemWriterAdapter
org.springframework.batch.item.reader.ItemReaderAdapter

Here's an interesting question -- how do you deal with something that needs to be both an ItemStream and a RepeatInterceptor?

Take org.springframework.batch.io.support.HibernateAwareItemWriter for instance -- suppose you want this to be transaction managed as an ItemStream, how would you do that?

 All   Comments   Work Log   Change History   FishEye   Builds      Sort Order: Ascending order - Click to sort in descending order
Douglas C. Kaminsky added a comment - 10/Feb/08 05:57 PM
I should clarify regarding the above posited question -- I understand that the method signatures of the open and close methods are different between the two, but it seems like there might be a way to improve the clarity in such a case.

Dave Syer added a comment - 11/Feb/08 02:59 AM
Good catch on the redundant close() methods - some were already fixed in another JIRA.

HibernateAwareItemWriter is not an ItemStream, so it is clear in that case. What would you suggest if there was to be an ItemStream that itself was a RepeatListener?

Dave Syer added a comment - 11/Feb/08 06:29 AM
The issue is resolved as described - if you want to continue the discussion about the overloaded method, can we do it offline?

Douglas C. Kaminsky added a comment - 11/Feb/08 10:28 AM
Sure - was just meant to provoke thought - I'll start a forum thread:
http://forum.springframework.org/showthread.php?t=49718

Dave Syer added a comment - 07/Aug/08 10:06 AM
Assume closed as resolved and released