Locking parent vertex while child is being updated.

Timon Schneider <timons...@...>

Hi all,

I have a question about locking data through Janusgraph.

Here’s the problem:
* We have a vertex with the label “type” with several properties
* Types have one edge “hasVersion” to a vertex with a label “version”
* This version vertex has a boolean property “published”.
* The type’s properties should not be allowed to be changed if the version’s published property is true.

We’re dealing with many concurrent user’s who might changes the type’s properties and set the version’s published property to true at the same time. And we need to be sure that the type’s properties are not change once it’s published.

Is there a way to lock the version vertex once the type is being changed in a transaction? This would make sure that the type is not published by a concurrent user while it is being changed.

We’re using the following configuration. Also we’re setting all relevant elements to ConsistencyModifier.LOCK through graph.openManagement().setConsistency.
        .set("storage.backend", "hbase")
        .set("storage.hbase.table", "testGraph")
        .set("storage.hostname", "localhost")
        .set("cache.db-cache", true)
        .set("cache.db-cache-clean-wait", 20)
        .set("cache.db-cache-time", 180000)
        .set("cache.db-cache-size", 0.5)
        .set("schema.constraints", true)
        .set("schema.default", "none")

Thanks in advance,

Join janusgraph-users@lists.lfaidata.foundation to automatically receive all group messages.