895 pts.
 AS400 Triggers
Hi,

I want to write a Trigger for a file. I want to test if the trigger can be fired only when the file operation is comitted in the program.

can you explain me this trigger concept in scenario such that......i update a file. This file has trigger associated with it. now suppose the program fails after i update the file and before program executes 'Comit' operation.....In such case I dun want the trigger to be fired as my operation is not comitted......Is there any work around for such scenario....

Can i write a simple routines to test my programs for such scenarios...

Thanks,

Nutan.



Software/Hardware used:
AS400
ASKED: August 31, 2009  9:22 PM
UPDATED: September 1, 2009  1:28 PM

Answer Wiki:
recent discussion http://itknowledgeexchange.techtarget.com/itanswers/trigger-program-written-in-rpgle/ ------------- 09/01/09 Didn't read your question closely enough. You trigger on add/update/delete not commit. The add/update/delete makes the file changes but keeps the records locked The Commit releases the locks and moves the boundry in the journal but doesn't fire a trigger. On the other hand, you could call a program at the point of the commit. Phil The journal will recieve each file update and if a rollback occurs the journal will recieve the roll back for each file that was changed. The journal has integrity. Apparently your trigger is writting to a log file, you may want to write to the log file also when you commit or rollback but you cann't do these with a trigger.
Last Wiki Answer Submitted:  September 1, 2009  1:28 pm  by  philpl1jb   44,070 pts.
All Answer Wiki Contributors:  philpl1jb   44,070 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

thanks Phil. I’m still confused with the concept of Comit operation on database….
I think there is no way I can make ‘Comit’ operation as the trigger event. If I’m not wrong then this is the limitation of AS400 Trigger ….This may mar integrity between the trigger log file and actual database update that has taken place….and there is no way to overcome this…

Please correct if I’m wrong..

Nutan.

 895 pts.