Myself and the big guns (my bosses) are confused about something we have happening here.
We are under the (apparently incorrect) belief that a 'do transaction' loop will prevent an 'undo' being done to a table.
We have a piece of code that basically does the following;
For each table no-lock
break by table.field:
if first-of table.field
then run p-procedure.
do more stuff which includes exclusive locks and updates on other tables.
end.
procedure p-procedure:
do transaction:
find table2 exclusive-lock.
variable = table2.field.
table2.field = table2.field + 1.
end.
end.
If the users session is killed for any reason (power outage, kicked cord, disgruntled user turning off computer - whatever) while the user is still in the 'do stuff' section of the for-each loop then table2.field suffers and 'undo' which takes it back to what table2.field was originally. Under NO circumstances do we want that field to roll back. And we're all under the impression that the 'do transaction' statement will handle that. Obviously we're wrong. Any suggestions on what to do to correct this?
Thanks, Mark.
We are under the (apparently incorrect) belief that a 'do transaction' loop will prevent an 'undo' being done to a table.
We have a piece of code that basically does the following;
For each table no-lock
break by table.field:
if first-of table.field
then run p-procedure.
do more stuff which includes exclusive locks and updates on other tables.
end.
procedure p-procedure:
do transaction:
find table2 exclusive-lock.
variable = table2.field.
table2.field = table2.field + 1.
end.
end.
If the users session is killed for any reason (power outage, kicked cord, disgruntled user turning off computer - whatever) while the user is still in the 'do stuff' section of the for-each loop then table2.field suffers and 'undo' which takes it back to what table2.field was originally. Under NO circumstances do we want that field to roll back. And we're all under the impression that the 'do transaction' statement will handle that. Obviously we're wrong. Any suggestions on what to do to correct this?
Thanks, Mark.