Re: [U2] UniData Triggers
Thank you for your replies! We also make use of master trigger subroutines that call subroutines so that is not an issue. I just wanted to be sure that the initial creation of an update trigger on a file would not affect current logged in users with that file open. We'll do the creation in the w hours of morning to mitigate the risk, but I'm seeing that should not be any, at least on an update trigger. I can imagine that a delete trigger could have some risk. Thanks again! Shaun Ferguson Applications Architect I Wolseley Group Services - 12500 Jefferson Avenue - Newport News - VA - 23602-4314 T: (757) 989-2916 - F: (757) 989-2801 - E: shaun.fergu...@wolseley.com www.wolseley.com http://www.wolseley.com/> Wolseley plc registered office Parkview 1220 Arlington Business Park Theale Nr Reading RG7 4GA United Kingdom Registration No. 29846 England ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] UniData Triggers
I agree! Triggers must be globally cataloged, but they can CALL a locally/directly cataloged subroutine that does all the real work. Also remember to CLOSE your files in the trigger program or you might hit a max file limit (this might not be an issue if the OPENs are done in the 2nd subroutine, but they will burn you for sure if they are in the parent subroutine). John Israel Senior Programmer/Analyst Dayton Superior Corporation 1125 Byers Road Miamisburg, OH 45342 -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bill Haskett Sent: Tuesday, June 14, 2011 12:02 PM To: U2 Users List Subject: Re: [U2] UniData Triggers Shaun: Remember, when you start going down the "trigger" path in UD, you may want to simply create two globally cataloged routines: U2.MASTER.TRIGGER.D U2.MASTER.TRIGGER.U ...or something like this. These two triggers simply "call" defined subroutines. We use a TRIGGER.CONF file like: 001 FileName@VMFileName@VMFileName... 002 UpdSubroutine@SVMUpdSubroutine@VMUpdSubroutine@VMUpdSubroutine... 003 DelSubroutine@SVMDelSubroutine@VMDelSubroutine@VMDelSubroutine... ...where field# 2 is used by the "update" trigger and field# 3 is used by the "delete" trigger. With a structure like this you'll be able to insert and remove subroutines into triggers (after you create the trigger), and use "local" subroutines. Plus none of the trigger programs, except the two master trigger programs, will need to be globally cataloged. HTH, Bill - Original Message - *From:* We are creating a trigger on a file that is used extensively in the > system. Is it necessary to logoff users when creating an update trigger > on a file or does UniData handle that when updating > the trigger information to the header of the file? The 'help' does not > specify whether trigger creation requires exclusive access to the file > or not. > > Thanks! > > Shaun Ferguson > Applications Architect I > Wolseley Group Services - 12500 Jefferson Avenue - Newport News - VA - > 23602-4314 > T: (757) 989-2916 - F: (757) 989-2801 - E: shaun.fergu...@wolseley.com > www.wolseley.comhttp://www.wolseley.com/> > Wolseley plc registered office Parkview 1220 Arlington Business Park > Theale Nr Reading RG7 4GA United Kingdom > Registration No. 29846 England > > > ___ > U2-Users mailing list > U2-Users@listserver.u2ug.org > http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] UniData Triggers
Hi, Problems on triggers comes when deleting a trigger while users are updating : if doing so, all future update of session which have opened file with trigger will fail if trigger has changed. There has been a good mail on triggers months ago. Generally, it's better to put a master trigger (which never will change) and a slave trigger called by master. Management tasks on triggers could be done online on slave. True with UniVerse. Don't know with UniData. Cheers. Christian -Message d'origine- De : u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] De la part de Jeffrey Butera Envoyé : mardi 14 juin 2011 17:16 À : u2-users@listserver.u2ug.org Objet : Re: [U2] UniData Triggers On 06/14/11 10:54, shaun.fergu...@ferguson.com wrote: > We are creating a trigger on a file that is used extensively in the > system. Is it necessary to logoff users when creating an update trigger > on a file or does UniData handle that when updating > the trigger information to the header of the file? The 'help' does not > specify whether trigger creation requires exclusive access to the file > or not. > I've had no issues setting up triggers on our production system with users logged in. -- Jeff Butera, Ph.D. Manager of ERP Systems Hampshire College jbut...@hampshire.edu 413-559-5556 "...we must choose between what is right and what is easy..." Dumbledore ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users Ce message et les pièces jointes sont confidentiels et réservés à l'usage exclusif de ses destinataires. Il peut également être protégé par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant être assurée sur Internet, la responsabilité du groupe Atos Origin ne pourra être recherchée quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne saurait être recherchée pour tout dommage résultant d'un virus transmis. This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos Origin group liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] UniData Triggers
Shaun: Remember, when you start going down the "trigger" path in UD, you may want to simply create two globally cataloged routines: U2.MASTER.TRIGGER.D U2.MASTER.TRIGGER.U ...or something like this. These two triggers simply "call" defined subroutines. We use a TRIGGER.CONF file like: 001 FileName@VMFileName@VMFileName... 002 UpdSubroutine@SVMUpdSubroutine@VMUpdSubroutine@VMUpdSubroutine... 003 DelSubroutine@SVMDelSubroutine@VMDelSubroutine@VMDelSubroutine... ...where field# 2 is used by the "update" trigger and field# 3 is used by the "delete" trigger. With a structure like this you'll be able to insert and remove subroutines into triggers (after you create the trigger), and use "local" subroutines. Plus none of the trigger programs, except the two master trigger programs, will need to be globally cataloged. HTH, Bill - Original Message - *From:* We are creating a trigger on a file that is used extensively in the system. Is it necessary to logoff users when creating an update trigger on a file or does UniData handle that when updating the trigger information to the header of the file? The 'help' does not specify whether trigger creation requires exclusive access to the file or not. Thanks! Shaun Ferguson Applications Architect I Wolseley Group Services - 12500 Jefferson Avenue - Newport News - VA - 23602-4314 T: (757) 989-2916 - F: (757) 989-2801 - E: shaun.fergu...@wolseley.com www.wolseley.comhttp://www.wolseley.com/> Wolseley plc registered office Parkview 1220 Arlington Business Park Theale Nr Reading RG7 4GA United Kingdom Registration No. 29846 England ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] UniData Triggers
On 06/14/11 10:54, shaun.fergu...@ferguson.com wrote: We are creating a trigger on a file that is used extensively in the system. Is it necessary to logoff users when creating an update trigger on a file or does UniData handle that when updating the trigger information to the header of the file? The 'help' does not specify whether trigger creation requires exclusive access to the file or not. I've had no issues setting up triggers on our production system with users logged in. -- Jeff Butera, Ph.D. Manager of ERP Systems Hampshire College jbut...@hampshire.edu 413-559-5556 "...we must choose between what is right and what is easy..." Dumbledore ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] UniData Triggers
UniData handles it just fine. You need to be the owner of the data file or root to build the trigger. John Israel Senior Programmer/Analyst Dayton Superior Corporation 1125 Byers Road Miamisburg, OH 45342 -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of shaun.fergu...@ferguson.com Sent: Tuesday, June 14, 2011 10:54 AM To: u2-users@listserver.u2ug.org Subject: [U2] UniData Triggers We are creating a trigger on a file that is used extensively in the system. Is it necessary to logoff users when creating an update trigger on a file or does UniData handle that when updating the trigger information to the header of the file? The 'help' does not specify whether trigger creation requires exclusive access to the file or not. Thanks! Shaun Ferguson Applications Architect I Wolseley Group Services - 12500 Jefferson Avenue - Newport News - VA - 23602-4314 T: (757) 989-2916 - F: (757) 989-2801 - E: shaun.fergu...@wolseley.com www.wolseley.com http://www.wolseley.com/> Wolseley plc registered office Parkview 1220 Arlington Business Park Theale Nr Reading RG7 4GA United Kingdom Registration No. 29846 England ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] unidata triggers and record locks
So, does your trigger actually handle LOCKED case "correctly"? If not, I'd suspect that you probably find that "sometimes people will have a session that just hangs (on the READU!?!) and you have to log them off/kill process to get them back" ring any bells? >-Original Message- >From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users- >boun...@listserver.u2ug.org] On Behalf Of Jeffrey Butera >Sent: 26 January 2011 7:07 AM >To: U2 Users List >Subject: [U2] unidata triggers and record locks > >Unidata 7.2.x on RedHat. We use update triggers a lot, often so that data >changes in file A are written/accumulated in file B. > >I've found cases where the data in file B is incorrect - if I look at file A, the >trigger should've updated B but did not. Moreover, if I pull the offending >record from file A into an editor and save out with no changes, the trigger >properly updates file B as it should. > >My guess is that record locks on file B may cause the update trigger to fail, but >I'm open to other suggestions. > >-- >Jeffrey Butera >Manager of ERP Systems >Hampshire College >413-559-5556 > >___ >U2-Users mailing list >U2-Users@listserver.u2ug.org >http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] unidata triggers and record locks
Jeffrey: I had to use the following code in my trigger to figure out what was going on. * ** Determine status of trigger call. * StatusOfCall = STATUS() * IF StatusOfCall = 1 OR StatusOfCall = 2 THEN * HLDMSG = TriggerToRun : " trigger for " : atFILENAME : ', ' : atID * HLDMSG := " did not execute. STATUS() is " : StatusOfCall * HLDMSG := " ExecStat is " : ExecStat * CALL LOGMSG ( '', 'N/A', HLDMSG, '' ) * END Unfortunately, one of the programs that was called from this routine was returning a STATUS() of 1. I have no idea why but I think that code was properly running. Anyway, this code got me to the error I was looking for. Maybe it will help you. HTH, Bill Jeffrey Butera said the following on 1/25/2011 12:06 PM: Unidata 7.2.x on RedHat. We use update triggers a lot, often so that data changes in file A are written/accumulated in file B. I've found cases where the data in file B is incorrect - if I look at file A, the trigger should've updated B but did not. Moreover, if I pull the offending record from file A into an editor and save out with no changes, the trigger properly updates file B as it should. My guess is that record locks on file B may cause the update trigger to fail, but I'm open to other suggestions. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users