pm_osc
pm_osc
Explore posts from servers
ATApache TinkerPop
Created by pm_osc on 5/17/2024 in #questions
Authorization with transaction results in error
Thanks a lot @Kennh for your help on this. Indeed, I missed the iterate() step when I converted our real scenario into a simplified one. Thank you for the background information on this and thanks to Lyndon for the proposed fix.
12 replies
ATApache TinkerPop
Created by pm_osc on 5/17/2024 in #questions
Authorization with transaction results in error
Thanks a lot @Kennh for looking into this. You are right, our main goal is to be able to use transaction in Gremlin Python. Please see the below Python code snippet for reproducing the "This AuthorizationHandler only handles requests with OPS_BYTECODE or OPS_EVAL." error with our real use case. Before running the snippet, gremlinpython 3.7.0 package needs to be installed.
from gremlin_python.process.anonymous_traversal import traversal
from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection

g = traversal().withRemote(DriverRemoteConnection('ws://localhost:8182/gremlin', 'g', username='stephen', password='password'))

# create a transaction
tx = g.tx()

# spawn a new GraphTraversalSource, binding all traversals established from it to tx.
gtx = tx.begin()

try:
# execute a traversal within the transaction.
gtx.addV().property('name', 'test1').property('age', 11)
# commit the transaction
tx.commit()
except Exception as e:
print(e)
# rollback the transaction if an error occurs
tx.rollback()
from gremlin_python.process.anonymous_traversal import traversal
from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection

g = traversal().withRemote(DriverRemoteConnection('ws://localhost:8182/gremlin', 'g', username='stephen', password='password'))

# create a transaction
tx = g.tx()

# spawn a new GraphTraversalSource, binding all traversals established from it to tx.
gtx = tx.begin()

try:
# execute a traversal within the transaction.
gtx.addV().property('name', 'test1').property('age', 11)
# commit the transaction
tx.commit()
except Exception as e:
print(e)
# rollback the transaction if an error occurs
tx.rollback()
Thank you.
12 replies
ATApache TinkerPop
Created by pm_osc on 5/17/2024 in #questions
Authorization with transaction results in error
Thank you for your message. Yes, with JanusGraph 1.0 and Gremlin Server 3.7.0, I see the very same error, that is why I think this is related to Gremlin Server and not JanusGraph specific issue. Thanks.
12 replies