parag2679
23rd January 2002, 17:56
Does abort.transaction() return program execution to the retry.point() and if not where id the control transferred
Also is it possible to transfer program control to the retry point based on a condition.
ie if < condition > then
' transfer control to retry point '
This condition and the point where i want to transfer control is in different functions.
Regards,
Parag
lbencic
23rd January 2002, 18:41
abort.transaction() does not execute the db.retry.point. It just releases any locks on any tables (cannot specify which) you have locks on (or delayed locks on). Control just passes to the next statement.
I am not sure how to force a retry, sorry. No commands are listed.
popeye
24th January 2002, 02:35
Parag,
You could use GO TO :) A strict "No No" though :)
What are you trying to accomplish with the "forced" retry?
If you can describe your “problem”, probably somebody can come up with another solution.
Cheers,
Madhu
parag2679
24th January 2002, 16:40
Hi,
Thanks for ur replies ..
But Goto cannot be used . I already tried that. I think it has scope restrictions to the function from which it is executed . As i mentioned in my first post the function where i check the condition and the point to which i am transferring control are in totally different functions
Basically it is an interface script that reads from an ASCII file and populates BaaN tables. Either all the records from the file are commited or none of them. So if some record is giving a problem we want to rollback the complete transaction and retry from the retry.point.
Another thing I would like to mention is that if i debug the script, use an abort.transaction() and use the goto in the denugger to start at the line no. after the retry.point() the file gets processed. So the problem is due to temporary locking of recs etc. that can be rectified in the retry.
Waiting for ur replies !!!!
evesely
24th January 2002, 17:35
Couldn't you just do something like this:
for i = 1 to max_retry_var
do your processing
if problem then
abort.transaction()
else
commit.transaction()
break
endif
endfor
pshipley
24th January 2002, 18:04
On the subject of comit.transaction() - in the standard source where there are masses of updates you often see a commit every 50 updates.
I assume that this is for performance reasons - I was wondering why 50? and is there a maximim value?
Phil