Janus\Cassandra - Graph does not support transactions

51 views
Skip to first unread message
Message has been deleted

ldau...@gmail.com

unread,
Feb 20, 2020, 10:46:24 AM2/20/20
to JanusGraph users
Using the docker-compose examples from https://github.com/JanusGraph/janusgraph-docker I have been able to spin up a Janus graph w/ elastic search and cassandra as the backend store. Then I have a java program in which I am trying to add Nodes and Edges to graph in a batch fashion. However if I see if I call g.addV nodes are automatically added and if I call g.tx().commit() I get the error "Graph does not support transactions". Is this expected? Is there a way to get Janus and Cassandra to utilize transactions? Sorry if this has been answered before but I have googled this and read much of the doc and there does not seem to be a straight ahead answer to this anywhere that I see.

Luke

configuration = new PropertiesConfiguration(filePath);
try
{
Cluster cluster = Cluster.open(configuration.getString("gremlin.remote.driver.clusterFile"));
client = cluster.connect();
}
catch (Exception e)
{
throw new ConfigurationException(e);
}

// using the remote graph for queries
Graph graph = EmptyGraph.instance();
g = graph.traversal().withRemote(configuration);

final Bindings b = Bindings.instance();
g.addV(b.of(LABEL, "titan")).property(NAME, b.of(NAME, "saturn")).property(AGE, b.of(AGE, 10000)).next();
g.tx().commit();


Luke Daugherty

unread,
Feb 20, 2020, 11:15:24 AM2/20/20
to JanusGraph users
Connecting by Gremlin console I can see:

gremlin> :> graph.features().graph().supportsTransactions()
==>true 

But in the java app this is set to false, so I assume this a client issue, but so far am unsure how to get around it...

Stephen Mallette

unread,
Feb 20, 2020, 11:29:39 AM2/20/20
to janusgra...@googlegroups.com
Remote traversals have a different mode of transaction management:


--
You received this message because you are subscribed to the Google Groups "JanusGraph users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/janusgraph-users/663b0726-0931-4350-8622-f34ce4c84bf9%40googlegroups.com.

Abhay Pandit

unread,
Feb 20, 2020, 11:36:08 AM2/20/20
to janusgra...@googlegroups.com
I don't think you need to commit your transaction when you are connecting remotely.
You are using ".next()" after query and it will commit your transaction.

Thanks,
Abhay Kumar Pandit

Luke Daugherty

unread,
Feb 20, 2020, 5:16:56 PM2/20/20
to JanusGraph users
Yea. For some reason this was not clear to me since I was just adding to the graph and not really querying anything, but calling.next() on the objects returned by addV worked. And I have been able to chain them together for batch processing. Thanks.
Reply all
Reply to author
Forward
0 new messages