JobLockService.getLock() 和 JobLockService.getLock() 之间有什么区别? JobLockService.getTransactionLock()

发布于 2024-11-27 16:23:28 字数 155 浏览 1 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

似最初 2024-12-04 16:23:28

看看这两个方法 signatures< /a>:

java.lang.String getLock(org.alfresco.service.namespace.QName lockQName,
                         long timeToLive)

返回一个String,即新创建的LockToken。您必须在对 refreshLockreleaseLock 以便手动管理锁的生命周期。

void getTransactionalLock(org.alfresco.service.namespace.QName lockQName,
                          long timeToLive)

void 方法,只需要一个QName。同一线程或其他线程可以调用此方法来尝试获取锁。对 getTransactionalLock 的调用将自动尝试刷新锁(如果锁可用/过期),而无需传递令牌。

Have a look at the two methods signatures:

java.lang.String getLock(org.alfresco.service.namespace.QName lockQName,
                         long timeToLive)

Returns a String, which is the newly created LockToken. You must use the token in following calls to refreshLock or releaseLock in order to manually manage the lock life span.

void getTransactionalLock(org.alfresco.service.namespace.QName lockQName,
                          long timeToLive)

void method, only asks for a QName. The same thread, or other threads, can call this method to try to acquire the lock. Following calls to getTransactionalLock will automatically try to refresh the lock in case it's available/expired, without the need to pass the token around.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文