Hi Folks,
I want to process a specific record but need to lock this record so it will not be processed by other users/ any running pre defined batch job.
Could anyone please help me out on this.
Thanks in advance!!
Hi Folks,
I want to process a specific record but need to lock this record so it will not be processed by other users/ any running pre defined batch job.
Could anyone please help me out on this.
Thanks in advance!!
As soon as you select a record using "forUpdate" inside a transaction scope (ttsbegin), that record cannot be changed by someone else until the transaction is comitted by the process who started the transaction by calling ttscommit. This is a simplified description of how this works but that's basically the idea.
If you are working "outside" transaction scopes with multiple users editing data at the same time and just want a "single user mode" type functionality for records. You can add some custom fields to the table that indicate it's locked and by who. Logic can be added to allow only editing accordingly.
Hi,
You can use Pessimistic lock but I think it will affect the performance.
https://learn.microsoft.com/en-us/dynamicsax-2012/developer/optimistic-concurrency-control
https://dev.goshoom.net/2011/10/pessimistic-locking/
Refer to the below blog.
Hi, You can check how system is Blocking the journals and try to replicate it.
André Arnaud de Cal...
294,261
Super User 2025 Season 1
Martin Dráb
233,017
Most Valuable Professional
nmaenpaa
101,158
Moderator