Transactions in Gremlin using Python


#1

I was trying to use transactions using the gremlinpython plugin. But it errors saying that
‘Graph’ object has no attribute ‘tx’

code:
from gremlin_python.structure.graph import Graph

graph = Graph()
g = traversal().withRemote(DriverRemoteConnection(‘ws://localhost:8182/gremlin’, ‘g’))
graph.tx().commit()

Is this error due to the python plugin? Are there any alternatives?


#2

Hi @ashish

that depends on the Gremlin Python.

You can check this couple of post here

https://groups.google.com/forum/#!topic/gremlin-users/lODr35_4TeI

https://groups.google.com/forum/#!topic/gremlin-users/7McuLqmazeE

Or ask directly to the gremlin forum.

Probably you would need to use the raw driver where you can send a script which contains multiple statement to run in a transaction

Thanks
Enrico


#3

Thank you for the reply.
I had earlier googled these links and had looked at the replies from Stephen Mallette.