Napsetern
Napsetern
ATApache TinkerPop
Created by Napsetern on 3/31/2023 in #questions
Custom MutationListener on Transaction
Hello everyone, I'm a beginner regarding tinkerpop and i'm trying to fire my custom listener after a transaction is done. I have registered an EventStrategy on my JanusGraph
graph.traversal().withStrategies(EventStrategy.build().eventQueue(new CustomTransactionnalEventQueue(graph)).addListener(new CustomListener(graph.traversal())).create())
graph.traversal().withStrategies(EventStrategy.build().eventQueue(new CustomTransactionnalEventQueue(graph)).addListener(new CustomListener(graph.traversal())).create())
The Custom transactionnal Event Queue is just a copy of the one in the EventStrategy class with logs at every step to help me find where the problem is . Now the problem : I have noticed that my transaction are never mark as committed. i tried a simple g.addV() :
gremlin> g.addV("aeaeazezeezee")
==>v[368652472]
gremlin> g.addV("aeaeazezeezee")
==>v[368652472]
and tried using
g.tx().commit()
g.tx().commit()
I see in my logs that the event are catched and added to the eventQueue but my listeners is never used on them since the status of my transaction is never marked as commited. I hope I'm clear in my explanation. I can provide more information/code if needed Regards
19 replies