New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call ItemStream open() and close() within a transaction [BATCH-2240] #1361
Comments
Michael Minella commented What you are describing from a use case isn't the intent of the In the JSR-352 scenario, the reason the In either case, there is nothing stopping you from using a |
Jimmy Praet commented The
Wrapping only the
Do you see any drawbacks with making opening and closing the streams transactional? Isn't the JSR-352 scenario you are describing also applicable to using spring-batch in a JEE environment? |
Michael Minella commented With regards to your specific points:
Another option that I didn't mention before is the use of a The drawbacks of making these methods transactional I see are:
With regards to the JSR-352 technical limitation and it's application to Spring Batch, it does apply. But as I mention above, it's a scenario that doesn't happen very often (from my experience) so handling this with a |
Jimmy Praet opened BATCH-2240 and commented
Can't the ItemStream open() and close() methods should be called within a transaction? The JSR 352 also describes this in the paragraph "11.6
Regular Chunk Processing", although it is indicated as being optional.
My use case is a writer that wraps around other writer delegate and transparently keeps track (in a database) of some business-specific statistics of the file that is being written too. Some of this metadata is already being persisted in the open() method. I would like these to be rollbacked when the open() of the delegate throws an exception.
Reference URL: http://stackoverflow.com/questions/26234720/jsr-352-spring-batch-transaction-management
2 votes, 4 watchers
The text was updated successfully, but these errors were encountered: