-
Jan 7th, 2008, 08:17 AM
#1
JDBC batch facility
Hi: I notice that the JDBC batch facilities are not used in any of the examples. Is this due to reliance on the DB manager to handle this processing?
-
Jan 7th, 2008, 08:58 AM
#2
We don't really provide any database ItemWriters, since there wouldn't be much value in doing so. (Unlike say, a file ItemWriter) You can easily create your own Dao (or ItemWriter) that takes advantage of Jdbc Batching. However, keep in mind that doing so can complicate error processing. To give an example, if you have a chunk of size 10, and the 5th record is bad, if you are using Jdbc batch to output them, you have no way of knowing the 5th record is bad, since all 10 were committed at once. You will receive one exception for all. This can be solved by rolling back the chunk, and processing each one at a time, which isn't too difficult, but please keep in mind that it does add an extra 'layer'.
-
Jan 7th, 2008, 09:14 AM
#3
yes....I see what you are saying about the error processing.....the supplied output writers, for flat files, do a very good job.
Thanks for the response
-
Jan 7th, 2008, 12:13 PM
#4
-
Jan 9th, 2008, 12:10 PM
#5
I looked at BATCH-76. Will it use the same approach as the solution for http://jira.springframework.org/browse/BATCH-194 ?
-
Jan 9th, 2008, 12:45 PM
#6
BATCH-194 was more about the fact that hibernate wouldn't flush the cache until the transaction was committed. Therefore, they weren't able to catch the error within developer code, since it wasn't thrown until the framework tried to commit a transaction.
However, the solution of using an interceptor may still have value if using a jdbc batching output solution.
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