[DUG] SQL Update

Eion McIntosh (Christchurch) e.mcIntosh at ppcs.co.nz
Wed Jul 20 14:55:44 NZST 2005


Hi

We have a program which runs each a user starts system we have to check whether a program is the background is still running by checking through the server active programs list that you can see from Task manager. If the program find the background process is not running it reset a variable on an SQL table, so that the next user that logs in, without knowing, automatically start the program running again.

We are having the occasional occurance of more than 1 copy of the background process running and have found that this variable that is being check is being reset to some process which we can't find what it is. A few people believe it is the checking program resetting this value when it does not think this process is running, when is actually is still running. We have check with SQL logs to find when the variable is being reset and have found when it is doing it, but it is only reseting one field, where we have the checking program update two fields on the record, one being a description, so we knew that this program was doing the resetting.

The update of the SQL table is very simple:

If SQL.Field1 = 1 then
begin
	SQL.Edit;
	SQL.Field1 := 0;
	SQL.Field2 :-= SQL.Feild2 + ' Reset';
	SQL.Post;
end;

Does any think or know of any possible reason that if this logic is resetting the field1, that is would update field2 at the same time? When testing the log showed both fields being updated but running live only field1 is begin reset, so this is why I can't see this logic is causing our second copy of the background process to start running.

Regards
Eion McIntosh
PPCS Ltd

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ns3.123.co.nz/pipermail/delphi/attachments/20050720/f540efa6/attachment-0001.html


More information about the Delphi mailing list