2023 Feb 03 4:38 PM
Hi community
I have a call transaction in loop to F-03 transaction and sometimes i receive a message :
Account 111111 is currently blocked by user YYYYYY
Are there a function or a way to see if account is blocked and i can use while command and exit of this while when the account is unblocked?
Thanks
2023 Feb 03 5:48 PM
You might use fm ENQUEUE_READ to check what locks are currently set in the system.
But it's not a good idea to use it in a loop, on and on, just in order to exit that loop. If you are able to spot a message like: "Account 111111 is currently blocked..." then why do you need to check this once again by calling some other function ? If your loop is able identify that message (returned by "call transaction" I suppose) then it's enough to decide whether to exit or not.
regards
2023 Feb 03 5:48 PM
You might use fm ENQUEUE_READ to check what locks are currently set in the system.
But it's not a good idea to use it in a loop, on and on, just in order to exit that loop. If you are able to spot a message like: "Account 111111 is currently blocked..." then why do you need to check this once again by calling some other function ? If your loop is able identify that message (returned by "call transaction" I suppose) then it's enough to decide whether to exit or not.
regards
2023 Feb 13 5:57 PM
Thanks
Maciej Domagala
I using wait up to seconds and solve the problem .
Thanks
2023 Feb 22 6:15 PM
HI the wait up to is bad to performance are there other way ?
2023 Feb 23 10:24 AM
If this is a batch input called in a loop and you get an error message due to lock set by the transaction called in previous loop pass (because the update has not finished yet) - then instead of checking whether the lock has been released or not - and instead of using "wait up to" - put this staement in your program before the loop begins:
set update task local
This way you force the system to perform the update within the current workprocess - not using asynchronous update processes. As a result when the "call transaction" finishes, the update is already finished: data saved to the database and locks already released.