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


aa5186 <arunab...@...>
 

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!

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