General discussion

  • Creator
    Topic
  • #2082022

    Commit/Rollback…..

    Locked

    by jhill ·

    I’m trying to add logic to an existing process…
    Here it is… Bear with me…
    The process is looping and for each loop, it performs a commit or a rollback.
    The new logic needs to insert some new data

All Comments

  • Author
    Replies
    • #3900331

      Commit/Rollback…..

      by john.payne ·

      In reply to Commit/Rollback…..

      Assuming the commit or rollback is performed based on the success or failure of the existing DML statments inside the loop, add your new logic to the block where the commit would have been performed and move your commit/rollback logic inside this same block, after testing for success/failure of your insert statements.
      i.e.
      if success then
      commit
      else
      rollback
      endif

      would become…
      if success then
      insert statment

      if success then
      commit else
      rollback
      endif
      endif

      Hope this helps.

      • #3741830

        Commit/Rollback…..

        by jhill ·

        In reply to Commit/Rollback…..

        The question was auto-closed by TechRepublic

    • #3900567

      Commit/Rollback…..

      by ruvic ·

      In reply to Commit/Rollback…..

      Some database like oracle has a special feature called “Savepoint” wherein you can selectively commit/rollback specific part of your code.

      Please check with your database.

      • #3741762

        Commit/Rollback…..

        by jhill ·

        In reply to Commit/Rollback…..

        The question was auto-closed by TechRepublic

    • #3741761

      Commit/Rollback…..

      by jhill ·

      In reply to Commit/Rollback…..

      This question was auto closed due to inactivity

Viewing 2 reply threads