The activity method commitwithErrorHandling is used in place of Obj Save as its not recommended but what are the error that this method allows us to commit in db?

The activity method commitwithErrorHandling is used in place of Obj Save as its not recommended but what are the error that this method allows us to commit in db?

@TanyaS58

commitWithErrorHandling is not an activity method, its a separate activity altogether. And it should not be mixed with the Obj-Save method. Obj-Save can be replaced with OOTB activity Save and Commit method can be replaced with commitWithErrorHandling activity.

@SohamM95 so why do we use commitWithErrorHanding in place of Commit?

@TanyaS58

commitWithErrorHanding has an inbuilt rollback feature. So if there’s any error that happens during the commit process, Pega will rollback the last point before commit. The Commit function will perform a DB commit in any case, even if there’s any error that happens on doing so, which is not recommended.

@SohamM95 I understood the difference but I am not getting exactly what error this CommitWithErrorHandling will handle?

@TanyaS58

It differs from scenarios, its not possible to go through the whole process here. You can go through the Pega documentation on how Commit works. Few scenarios that might need error handling are lock lost error, deferred save failed error, DB not available error etv.