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

Robert Dale <rob...@...>

Don't mix the Graph API and the Traversal API.  Prefer the Traversal API.

// in two traversals
newNode = g.addV("B").property("x",x).property("y",y).property("z",z).property("w", w).next()

// In one traversal
g.addV("B").property("x",x).property("y",y).property("z",z).property("w", w).as("newNode").V().hasLabel("A").has("x",x).has("y").addE("rt").to("newNode").iterate()


Robert Dale

On Mon, Jul 17, 2017 at 6:53 PM, aa5186 <arunab...@...> wrote:
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").
Vertex newNode = tx.addVertex(T.label,"B",
for(Vertex node: nodes){

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?


You received this message because you are subscribed to the Google Groups "JanusGraph users list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
For more options, visit

Join to automatically receive all group messages.