Announcement Announcement Module
No announcement yet.
What If StoredProcedureItemReader Retrieves Multiple Result Sets? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • What If StoredProcedureItemReader Retrieves Multiple Result Sets?

    If StoredProcedureItemReader invokes a stored procedure which returns multiple result sets, will all items in all these result sets be passed through the same processor and the same writer of the chunk-oriented step?

    It would be great, if I can write items from different result sets into different database tables...

  • #2
    StoredProcedureItemReader doesn't know what to do with multiple result sets. You would have to write your own reader and unpack the items with a wrapper to tell the downstream components (processor, writer) how to deal with them. If they were simply Objects of a different type, your Writer could send them to a DAO that knows how to dispatch to different tables based on type. There's nothing magical there.


    • #3
      If the invoked stored procedure gives multiple resultsets, will StoredProcedureItemReader return items of the first resultset, or will it return nothing?