[
https://issues.apache.org/jira/browse/TINKERPOP-1839?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16259866#comment-16259866
]
David Pitera commented on TINKERPOP-1839:
-----------------------------------------
Is `context` here bound to the console's `Context` i.e. the context of this WS'
request session? Or is it bound the GremlinScriptEngine's context
https://github.com/apache/tinkerpop/blob/87bf0c62ccd30c00aeb8be8306b323ea3ee514c3/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GremlinGroovyScriptEngine.java#L327
?
Furthermore, it would be best to ensure you can act on the
GremlinGroovyScriptEngine's context object directly in java code, i.e. not just
inside the context of a console connection. This would allow JG to handle the
binding itself, without forcing users to 1. handle the binding themselves and
2. do so in the context of a gremlin console connection. I did not see a way to
grab the GremlinGroovyScriptEngine's context from a quick glance at the code.
> We need a way to dynamically modify global bindings on the Gremlin Server.
> --------------------------------------------------------------------------
>
> Key: TINKERPOP-1839
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1839
> Project: TinkerPop
> Issue Type: Improvement
> Components: server
> Affects Versions: 3.2.6
> Reporter: David Pitera
>
> This question on StackOverflow
> https://stackoverflow.com/questions/47342524/how-to-traverse-graph-created-using-configuredplanfactory-in-janusgraph/47354728?noredirect=1#comment81670711_47354728
> along with the fact that most language client's interact with the Gremlin
> Server through the use of a variable bound to a graph of traversal reference,
> i.e. `graph` is usually bound to a graph and `g` is usually bound to its
> traversal
> https://github.com/apache/tinkerpop/blob/master/gremlin-server/scripts/empty-sample.groovy#L40
> mean that we need a way to bind these dynamically created graphs to the
> script executor.
> With JanusGraph's notion of dynamic graphs, there is no way to make use of
> the `withRemote()` functionality or make use of language clients demanding
> the traversal reference be bound to a variable.
> Therefore, we need a way to dynamically modify the global bindings on the
> gremlin script engine without having to restart the server.
> Note; I answered the original stack overflow question above, however I am
> pretty sure my answer is actually incorrect because the global binding will
> be evaluated once at server start and the evaluated references will be stored
> in the map and passed into the gremlin executor. Is this true?
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)