Announcement

Collapse
No announcement yet.

Using nextval() and multiple insert statements

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using nextval() and multiple insert statements

    I have multiple table inserts being performed in one transaction. Can anyone tell me if Mirth is using the doCommit or doRollback functions automatically when closing a connection or when an error occurs? Or do I need to call them based on response?

    I'm concerned that if an insert fails, I need to do something to rollback, or I'm going to have partial data inserted into my database.

    I'm using PostgreSQL 8.2

    Thanks in advance!

  • #2
    Re:Using nextval() and multiple insert statements

    It would appear that my concerns are valid. I've got multiple insert statements in a destination using a postgres enabled database writer. I query for a nextval, then input that int into the remaining statements. I close the connection at the end of my script. When I get an error, the data persists in the database from previous inserts in the same script. There is no rollback.

    Is this something that needs to be accounted for in postgres ("auto commit") or in the javascript of Mirth?

    Comment


    • #3
      Re:Using nextval() and multiple insert statements

      If you are using non-Javascript DB destinations you can enable "Transaction Endpoints" on the channel summary page and Mirth will wrap them into a transaction - otherwise you have to do it manually (in the Javascript).
      Chris Lang

      Comment


      • #4
        Re:Using nextval() and multiple insert statements

        Thanks for the help Chris. I'll give it a try.

        Comment

        Working...
        X