[
https://issues.apache.org/jira/browse/TINKERPOP3-910?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14978019#comment-14978019
]
ASF GitHub Bot commented on TINKERPOP3-910:
-------------------------------------------
Github user spmallette commented on a diff in the pull request:
https://github.com/apache/incubator-tinkerpop/pull/122#discussion_r43231045
--- Diff:
gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/GremlinServerIntegrateTest.java
---
@@ -562,4 +568,98 @@ public void shouldBlockWhenMaxConnectionsExceeded()
throws Exception {
cluster.close();
}
}
+
+ @Test
+ public void
shouldExecuteInSessionAndSessionlessWithoutOpeningTransactionWithSingleClient()
throws Exception {
+ assumeNeo4jIsPresent();
+
+ final SimpleClient client = new WebSocketClient();
+
+ //open a transaction, create a vertex, commit
+ final CountDownLatch latch = new CountDownLatch(1);
+ final RequestMessage OpenRequest =
RequestMessage.build(Tokens.OPS_EVAL)
+ .processor("session")
+ .addArg(Tokens.ARGS_SESSION, name.getMethodName())
+ .addArg(Tokens.ARGS_GREMLIN, "graph.tx().open()")
+ .create();
+ client.submit(OpenRequest, (r) -> {
+ latch.countDown();
+ });
+ assertTrue(latch.await(1500, TimeUnit.MILLISECONDS));
+
+ final CountDownLatch latch2 = new CountDownLatch(1);
+ final RequestMessage AddRequest =
RequestMessage.build(Tokens.OPS_EVAL)
+ .processor("session")
+ .addArg(Tokens.ARGS_SESSION, name.getMethodName())
+ .addArg(Tokens.ARGS_GREMLIN,
"v=graph.addVertex(\"name\",\"stephen\")")
+ .create();
+ client.submit(AddRequest, (r) -> {
+ latch2.countDown();
+ });
+ assertTrue(latch2.await(1500, TimeUnit.MILLISECONDS));
+
+ final CountDownLatch latch3 = new CountDownLatch(1);
+ final RequestMessage CommitRequest =
RequestMessage.build(Tokens.OPS_EVAL)
+ .processor("session")
+ .addArg(Tokens.ARGS_SESSION, name.getMethodName())
+ .addArg(Tokens.ARGS_GREMLIN, "graph.tx().commit()")
+ .create();
+ client.submit(CommitRequest, (r) -> {
+ latch3.countDown();
+
+ });
+ latch3.await(1500, TimeUnit.MILLISECONDS);
--- End diff --
I can add that. `SimpleClient` stinks - we need this done:
https://issues.apache.org/jira/browse/TINKERPOP3-916
> In session transaction opened from sessionless request
> ------------------------------------------------------
>
> Key: TINKERPOP3-910
> URL: https://issues.apache.org/jira/browse/TINKERPOP3-910
> Project: TinkerPop 3
> Issue Type: Bug
> Components: server
> Affects Versions: 3.0.2-incubating
> Reporter: Dylan Millikin
> Assignee: Dylan Millikin
> Fix For: 3.1.0-incubating
>
>
> When running a series of in session and sessionless request from *the same*
> client, an in session transaction can be opened by a sessionless request.
> This failing test (in GremlinServerIntegrateTest.java) demonstrated this:
> https://github.com/PommeVerte/incubator-tinkerpop/commit/f8d4e618a74821f72dc1e3c107cd3b30d34917f2
> If these same requests are made from two different clients there are no
> issues (see test in GremlinDriverIntegrateTest.java)
> Rundown of what the tests do :
> - Open a transaction (in session)
> - Add vertex (in session)
> - Commit transaction (in session)
> - Test if transaction is closed (in session) {{=TRUE}}
> - Send sessionless read request.
> - Test if transaction is closed(in session) {{=FALSE}} <--- bug should be
> {{=TRUE}}
> The bug only occurs if there's a sessionless read, and if the read returns
> elements (not {{FastNoSuchElement...}}).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)