Question
Infosys
IN
Last activity: 11 Nov 2016 2:09 EST
Regarding database commit in Declare Triggers
The following line is from Pega 7 Help:
"An activity of type Trigger may alter properties, call functions and execute other rules, but do not perform database commits. "
In the following PDN post (https://collaborate.pega.com/question/declare-trigger-committed-save-firing-commit) , a person has mentioned that s/he is using a Declare trigger activity to Queue a Work Object to an agent. This would involve creation of a record in pr_sys_queues table. How is this possible if we consider the line from Pega 7 Help. Can somebody help me understand the meaning of "but do not perform database commits"?
***Updated by Moderator: Marissa to update categories***
Hello Tuhinguha,
The trigger activity can put things like the queue item save onto the deffered list, for another process to commit. For a deffered save/delete trigger, that would be fine because there will be a later coomit to get everything down to the DB. In the case of a trigger fired on commit, I believe it will fire before the commit action is done on the database. So in essense, I believe the other poster you linked to is working off of a flawed assumption. I looked through the help and it isn't entirely clear, and it's been a while since I've played with this so my memory could be wrong. You could certainly test this fairly easily by adding a counter to an object and then creating a commit trigger that will add one to it. After the commit, you open the item, has the counter gone up by one or two?
Thanks,
Mike