0 Replies Latest reply on Sep 29, 2010 10:57 AM by MOMO Kisito

    Bulk operation design

    MOMO Kisito Newbie

      Hi
      i would like to know the best pratices to migrate from a single event or conversational request to a bulk operation on that request. A sample:


      in my web app user can create order. This can be done in one event or conversation:
      - user send it's request
      - seam setup context
      - inject customer from the context // by seam framework
      - order.create()
      - orderLine.create
      - seam teardown context


      Later we need to create many order in one bulk operation. And i want to reuse later code use to create one order
      - user send it's request
      - seam setup context
      for each order in list
      -inject customer // one problem here because customer change after each loop iteration
                       // and all loop operation are done in the same event context
      - order.create  // same problem as the previous
      - ordeLine.create // same pb
      end for
      - seam setup context


      to work around this problem this is a solution i propose



      - user send it's request
      - seam setup context
      for each order in list
      - setup my proper context
      -inject customer
      - order.create
      - ordeLine.create
      tear down my proper context
      end for
      - seam teardown context


      but this look like very complicated to me. Some one have any best solution