Hi
We have a strange locking message in our customized code.
"The xy table cannot be locked or changed because it is already locked by the user with the id zz. Waint until the user is finished an then try again."
It is a message or an error, but not the common text shown in the status line at the bottom of the active window. The common text is "The xy table is locked by ab, press crtl+break to cancel..."
BTW: The text is located in fin.etx.
Anybody knows under what circumstances the message is shown (instead of the "normal" message?
Thanks in advance
Thomas
0
Comments
RIS Plus, LLC
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I can reproduce the message if the table is locked and another process issues the locktable(false) command.
It's a native db.
However, there are some open questions:
1) In our customized code there is NO locktable(false). Without locktable(false) the error is not reproducable in my dummy codeunits. So I still wonder why this error occurs in our customized codeunits.
2) I have 2 Codeunits
This is Codeunit-1
While Codeunit-1 is idling, codeunit-2 issues table.locktable without an error. I guessed that there would be an error because transaction from Codeunit-1 is not finished then.
Hope somebody could bring some light in these misterious matter :?
You need to make your custom code aware of other processes, and either pass the record by reference or get the record again right before you modify it.
RIS Plus, LLC
Thanks for your explanations.
But I still dont get the point why
a)... it's not possible to reproduce the originally posted error msg
and
b)...I don't get an error message with my 2 Codeunits configuration. I thought that while Codeunit-1 is sleeping, the transaction is still open and no other proces could lock that table.
Regards
Thomas
RIS Plus, LLC