JobLockService.getLock() 和 JobLockService.getLock() 之间有什么区别? JobLockService.getTransactionLock()
JobLockService.getLock() 和 JobLockService.getLock() 之间有什么区别? JobLockService.getTransactionLock() ?从实践角度和理论角度?
谢谢 穆罕默德·阿米尔 高级系统开发人员 数码系列有限公司
What the difference between JobLockService.getLock() & JobLockService.getTransactionLock() ? from practical perspective and theoretical perspective ?
Thanks
Mohammed Amr
Senior System Developer
Digital Series Co,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看看这两个方法 signatures< /a>:
返回一个
String
,即新创建的LockToken
。您必须在对refreshLock
或releaseLock
以便手动管理锁的生命周期。void
方法,只需要一个QName
。同一线程或其他线程可以调用此方法来尝试获取锁。对getTransactionalLock
的调用将自动尝试刷新锁(如果锁可用/过期),而无需传递令牌。Have a look at the two methods signatures:
Returns a
String
, which is the newly createdLockToken
. You must use the token in following calls torefreshLock
orreleaseLock
in order to manually manage the lock life span.void
method, only asks for aQName
. The same thread, or other threads, can call this method to try to acquire the lock. Following calls togetTransactionalLock
will automatically try to refresh the lock in case it's available/expired, without the need to pass the token around.