Mirth Connect 3.12.0 Released!

Mirth Connect 3.12.0 is now available as an appliance update and on our GitHub page. This release includes database performance improvements, improves visual HL7 representation, message pruning, keystore handling, PDF generation, community contributions, and fixes several security vulnerabilities. This release also contains many improvements to commercial extensions. See the release notes for the list of fixes and updates.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

Using nextval() and multiple insert statements

  • 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?


    • #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


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

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