Announcement Announcement Module
Collapse
No announcement yet.
Batch updates orders Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Batch updates orders

    Hello everyone !

    I've been handling a Spring Batch project for a few weeks and I have a problem with its batch updates' execution order in transactional mode.

    I need to read lines from an Excel file and, according to the lines' content, make an update or insert query in an Oracle database. I used the normal template (a reader to read the lines, a processor to process them, a mix of CompositeWriters and ClassifierCompositeWriters to sort out my updated and inserted lines...)

    The problem is that I want my job to be transactional, and I sometimes need to update a record inserted earlier in my job execution. By turning on Spring's Log4J, I discovered that it uses JDBC batch updates to handle the queries. But it seems to execute the update queries before the insert queries, causing the update queries not to execute and leaving me with only my insert queries written in database.

    So here is my question : Is there anything I can do to control the order in which my queries are executed by Spring Batch's JDBC update batch when my transaction is commited ?

    Thank you in advance !
    Last edited by Samahell; Jun 17th, 2010, 01:09 PM. Reason: typos
Working...
X