简体   繁体   中英

Issues with updating vertex property in Titan graph database

In my Titan graph db, JobLockStatus can be (F)ree or (B)usy based on some condition.

N number of jobs are trying to alter the joblockstatus at the same time for RequestId=203. I am using below query to update the value:

GraphTraversal<Vertex, Vertex> ab =
traversalSource.V().has("RequestJob", "RequestId", 203).has("JobLockStatus","F").property("JobLockStatus", "B").iterate();  

updating the value of JobLockStatus from "F" to "B" should happen only once, by any one of the job, at any time. But in my case, many jobs are altering the value. How can I avoid such a concurrency issue?
Kindly help me to resolve the problem.

解决了这个并发问题..通过在jobLockStatus..so上随时使用consistencyModifier.Lock,只有一个作业可以锁定joblockstatus并更新它..当两个并行作业试图锁定时,只有一个作业会锁定它,其他作业将获取permanantLockException ...然后使用java中的try catch处理异常...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM