About Transaction Management

We would like to use Smart Service to delete records from the DSE (Data Store Entity) and create records according to the input received from the screen.
In this case, will the Delete and Write transactions be separated?
For example, if Write after Delete fails for some reason, I would like the Delete transaction to rollback.

Please let me know if there is a way to execute Delete and Write in the same transaction on Smart Service.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    I my experience, it is a better approach to not make the database manage a transaction, but to look at the Appian process to be that instance.

  • Probably for the first time ever I have to disagree with you. Here's why;

    • Execute the Delete Smart Service - this works
    • Execute the Write Smart Service - this fails
    • (Now I have to design a rollback to write back to the DB the rows I just deleted.)
    • I execute the rollback thread - this also fails
    • Now I am (as we say here) in a complete muddle!

    Until we get native "Begin Transaction" , "End Transaction", "Rollback Transaction" commands that can bracket multiple Smart Services in an Appian Process then by far the safest and reliable method is to use the DB's native functionality and incorporate this in a Stored Procedure.

Reply
  • Probably for the first time ever I have to disagree with you. Here's why;

    • Execute the Delete Smart Service - this works
    • Execute the Write Smart Service - this fails
    • (Now I have to design a rollback to write back to the DB the rows I just deleted.)
    • I execute the rollback thread - this also fails
    • Now I am (as we say here) in a complete muddle!

    Until we get native "Begin Transaction" , "End Transaction", "Rollback Transaction" commands that can bracket multiple Smart Services in an Appian Process then by far the safest and reliable method is to use the DB's native functionality and incorporate this in a Stored Procedure.

Children