开发者

What the difference between 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 Seri开发者_运维问答es Co,


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜