Announcement Announcement Module
Collapse
No announcement yet.
BatchUpdate question... How best to insert and update with BatchUpdate Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • BatchUpdate question... How best to insert and update with BatchUpdate

    I'm looking for the most efficient way to perform a batchUpdate() without knowing up front whether the items are to be Inserted or Updated. The items to be inserted/updated can be up to 5000 items, and so querying each individual prior to Inserting or Updating does not seem very efficient, as there is no BatchQuery() function available yet for Spring's JDBC module. The alternative is to run the batchUpdate for the Update first, ignore all exceptions and then run an additional batchUpdate for Inserting, however this assumes that if the Exception gets thrown for the update first it won't prevent the rest of the items to be updated.

    An additional note, these 5000 items, a portion of these may be inserted and some to be updated, so depending on the approach would need to Insert a subset and Update the rest.

    Anybody have an idea what the best approach?

    Thanks in advance!
    -Marcelo
Working...
X