New websocket connection on each traversal
I am using gremlin for traversing the janusgraph data via my java spring application. I am initiating the graph as below snippet
@Bean
public GraphTraversalSource g(Cluster cluster) {
return AnonymousTraversalSource.traversal().withRemote(DriverRemoteConnection.using(cluster)); // Or "conf/remote.yaml"
}
However, I see on each API call which triggers traversals, a new websocket connection is created, connection pool is opened and eventually closed. This adds lot of latency to my API. My expectation is that websockets are long running connections and should not be recreated every time.
What am I missing here?3 Replies
are you using transactions (i.e.
g.tx()
)?yes @spmallette I am using sessionless transactions.
i'm sorry but you wrote that answer in a conflicting way because you said "yes" which presumes you are using
g.tx()
but then followed by saying you were using "sessionless transactions". g.tx()
makes use of a session and is not "sessionless" so i'm not clear on what you meant. could you please clarify your answer?