I am trying to get modify vertices on a remote Gremlin Server using a traversal but it seems that only in the traversal in which a vertex is created I can also add properties, when starting a new traversal I properties are not added.
Scala/Java cluster connection setup code:
val mapper = GryoMapper.build()
val cluster = Cluster.build().serializer(new GryoMessageSerializerV1d0(mapper)).create
val client = cluster.connect[org.apache.tinkerpop.gremlin.driver.Client.ClusteredClient]()
val graph = EmptyGraph.instance()
val g = graph.traversal().withRemote(DriverRemoteConnection.using(cluster, "g"))
this works:
val v1 = g.addV("person").property("name","stephen").next()
this does not:
g.V(v1.id()).property("age","27")
this does not either and even throws a java.lang.IllegalStateException (propertyAdditionNotSupported) because the vertex is a org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertex:
v1.property("age","27")
If I use a Gremlin Console and remote connect to the Gremlin Server I do both without any issues.
:remote connect tinkerpop.server conf/remote.yaml
gremlin> :> g.addV('person').property('name','stephen')
==>v[82128]
gremlin> :> g.V(82128).property('age','27')
==>v[82128]
gremlin> :> g.V(82128).valueMap()
==>[name:[stephen],age:[27]]
Is the Java remote implementation bugged or am I missing something?