Exception: IllegalStateException: The vertex or type is not associated with this transaction

26 views
Skip to first unread message

aa5186

unread,
Jul 18, 2017, 8:19:31 AM7/18/17
to Gremlin-users
Hi all,

I am trying to add a new vertex and associate a new edge from it to an existing vertex. It doesn't allow me to add the edge and throws the exception:
java.lang.IllegalStateException: The vertex or type is not associated with this transaction [v[16552]]

```
List<Vertex> nodes = g.V().hasLabel("A").
has("x",x).
has("y",y).toList();
Vertex newNode = tx.addVertex(T.label,"B",
"x",x,
"y",y,
"z",z,
"w",w);
for(Vertex node: nodes){

node.addEdge("rt",newNode);
}
graph.tx().commit();
```
From what I understand, the "nodes" are not part of the tx transaction (...?) and therefore, the edge between "node" and "newNode" is not possible.
Can someone please point me in the right direction as I am new to Graph databases?

Thanks!

Jason Plurad

unread,
Jul 18, 2017, 9:46:10 AM7/18/17
to Gremlin-users
Seems like this question was previously asked and answered here:
https://groups.google.com/d/msg/janusgraph-users/dg9LQ2l6aJA/y1EBySENAgAJ

If you require additional follow up beyond what Robert already answered, it is probably best to reply on that thread so everybody has context of the full conversation. Thanks.

aa5186

unread,
Jul 19, 2017, 6:40:04 AM7/19/17
to Gremlin-users
That question (https://groups.google.com/d/msg/janusgraph-users/dg9LQ2l6aJA/y1EBySENAgAJ) was asked by me and Robert's answer helped me resolve the issue :)
Reply all
Reply to author
Forward
0 new messages