Customer Portal

TRUNCATE TABLE and Transactions

Comments 1

  • Avatar
    slechtaj
    0
    Comment actions Permalink
    Hi Andrew,

    In order to wrap statements in DBExecute with DBOutputTable DML statements into one transaction, you will need to do the following:

    • Set threadSafeConnection attribute to false - in Database connection dialog go to Advanced tab and uncheck Thread-safe connection check-box. See our documentation for more information on this.

    • Make sure DBExecute is in a phase with lower number than the one which is used for DBOutputTable.

    • Set DBExecute's attribute Transaction set to Never commit.

    • In DBOutputTable dialog set Action on error attribute to Rollback

    I would also recommend you using DELETE instead of TRUNCATE since TRUNCATE causes implicit mapping, therefore you won't be able to rollback the statement in case of DBOutputTable failure. For more information on implicit mapping refer to MySQL documentation (5.7).

    Hope it helps.

Please sign in to leave a comment.