RE: Set Lock Mode To Wait 30 in environment?
Posted in 2005
This is where programming techniques standardization came in to play here at my customer site. Now, I'm NOT a programmer, I'm a logistician. However, I wind up having to fix most of the ad hoc stuff and write all the heavy analysis jobs on the database. Almost DAILY, we have a request to make a GLOBAL change in file destinations, email addresses, report locations, or some such thing. One of the first things I did when I took over as the Sr. DBA/Analyst on site was to STANDARDIZE all of the ad hoc code and rewrite all of the crons. I do NOT like to use global variables in programming. By using standardized variable and naming conventions, and very simple and basic structures and modularity in writing, I'm able to have simple shell script utilities that can go through all of the code and make global changes. The basic steps are: 1. Establish a naming convention 2. Establish a fixed programming structure 3. ENFORCE these with very draconian measures 4. Shell script change package (I'll use email addresses as an example): a. ID location of files to change or feed it a list b. Cat the files through a cyclic loop and sed the data element EXAMPLE PSEUDO CODE SNIPET FOR PROCESSING BY DIRECTORY old_email_addr="id10t@aol.com" new_email_addr="id10t@govt.com" for JOB_DIR in dir_name dir_name dir_name do cd ${JOB_DIR} ls -1 *.sh | while read file_spec do cat ${file_spec} | \\ sed "s/${old_email_adr}/${new_email_adr}/g" \\ > ${TMP}/${file_spec}.tmp mv ${file_spec} ${file_spec}.bkup mv ${file_spec}.tmp ${file_spec} done done END PSEUDO CODE You can do the same thing for entire key phrases as long as you have a UNIQUE identifier for them; this is where standardization comes in to play. BUT YOU MUST REVIEW ALL CHANGES, even if it is a thousand lines of code. This is where vi search comes in (I love vi!). Rob -----Original Message----- From: owner-informix-list@iiug.org [mailto:owner-informix-list@iiug.org] On Behalf Of Art S. Kagel Sent: Thursday, September 22, 2005 5:04 PM To: informix-list@iiug.org Subject: Re: Set Lock Mode To Wait 30 in envirionment? Bill Hamilton wrote: > This is IDS 9.4 . > > There are many programs around here (c++/ado/Windows) where programmers > did not set the lock mode anyplace in their programs. > > Changing DEADLOCK_TIMEOUT won't help. > What I would like is to cause the default behavior to wait N seconds. > I cannot find any ONCONFIG parameter or environment variable that seems to > do that. > Is there such a thing? No. Nothing for it but to fix those apps. That's why there are code reviews! Art S. Kagel sending to informix-list