In terms of SQL when we start a transaction using BEGIN keyword and trying to save, rollback can be used if we get some errors and it will rollback to the previous state where we used BEGIN keyword likewise in pega how can we start a transaction with BEGIN keyword so i can rollback to the state before i started the transaction
@BalasubramaniamC4942 So you can achieve this in Pega activities.
You can create an instance of any table and then obj-Save it. But do not commit it as committing it will commit the transaction.
At this stage if you want to rollback because of some reason then you can call the Rollback method in activity and it will rollback all the uncommitted changes.
You can find more information in the below article.
@B.Puneet thanks for your reply, if we r doing something and error came and we rollbacked means the other operations which is not currently committed will also be affected which we dont want if we start a particular transaction and an error occured within that transaction, i want to rollback that particular transaction only, my rollback should not affect anyother transaction
@BalasubramaniamC4942 In Pega, transactions start implicitly when an activity starts. Operations like Obj-Save or Obj-Delete are part of the transaction and are not immediately persisted to the database. These operations are committed when the activity ends or when a Commit method is called. If you want to rollback any uncommitted operations, you can use the Rollback method. However, there isn’t a direct equivalent to the SQL BEGIN keyword in Pega.
This is a GenAI-powered tool. All generated answers require validation against the provided reference
Commit or roll back operation after update results on multiple tables