Posted: 5 Jun 2018 4:34 EDT Last activity: 17 Jun 2018 20:54 EDT
Commit or roll back operation after update results on multiple tables
We have multiple tables and want to commit after we make sure Pega is able to update / insert into all tables. If any of them fails for any reasons, then I want all tables to roll back. Let's say, we have following 2 classes:
Sandbox-Data-Customer (Customer table)
Sandbox-Data-Contract (Contract table)
In an activity, if I am able to update or insert into two of them successfully, I commit. If Customer table is updated but Contract table is for some reason unreachable and DML fails, then roll back.
#1. How would I implement such requirement?
#2. Does it make any difference if I am using Obj method or RDB method? In some scenario I would be using RDB method and need to make sure if it is still feasible.
Thanks, I am working together with the author. I understand in Obj method it is feasible by the step you described. For RDB method, I understand RDB operations are implicit commit, but in our projects some of the operations require RDB method - in that case do you think delete operation as rollback is the only way? Is there any better approach you can think of?
#1. I see all out-of-the-box stored procedures are named starting with "SPPC_" or "SPPR_" but is this mandatory? If I name it differently it won't work?
#2. I have created a sample stored procedure in Oracle database. Now, how exactly would I pass IN parameter to stored procedure and receive OUT parameter back to Pega? Real sample codes would be greatly appreciated. If you are referring to any documentation that would be helpful too.