Announcement Announcement Module
Collapse
No announcement yet.
JDBC batch facility Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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?

  • #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'.

    Comment


    • #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

      Comment


      • #4
        See also http://jira.springframework.org/browse/BATCH-76. It is scheduled for 1.0.

        Comment


        • #5
          I looked at BATCH-76. Will it use the same approach as the solution for http://jira.springframework.org/browse/BATCH-194 ?

          Comment


          • #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.

            Comment

            Working...
            X