[ 
https://issues.apache.org/jira/browse/TINKERPOP3-875?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14950292#comment-14950292
 ] 

stephen mallette commented on TINKERPOP3-875:
---------------------------------------------

ugh - lots of stuff at play here.

{code}
t.V(); graphT.tx().commit()
{code}

interesting.....not sure what to make of that immediately.

{code}
data = t.V(); graphT.tx().commit(); data
{code}

yes - that blows.

so let's do this.  making that that setting for auto vs. manual {{ThreadLocal}} 
seems like the right thing to do.  Can you please start a thread on that in the 
dev mailing list (breaking changes should be discussed as we know)?

Let's leave this issue open to sort out the "I don't need a transaction open 
when manual transactions are configured" thing.  I think there's some weird 
interplay between sessionless and manual transactions.  I mean if you are 
sessionless, you really shouldn't be trying to do manual transactions anyway so 
there's probably some double transaction work happening there.  I'm not sure 
I'd call that a "bug" but it's just some mis-usage that is allowed that's 
causing the problem.  I'm not so sure how easy it is to correct actually to 
prevent folks from shooting themselves in the foot.  If I'm in sessionless and 
I issue:

{code}
graph.tx().onReadWrite(Transaction.READ_WRITE_BEHAVIOR.MANUAL)
{code}

I just changed the transaction mode for that thread (assuming we make the 
change to make that setting {{ThreadLocal}}).  But why would I even do that in 
the first place to a sessionless connection?  Not like I'm going to be 
guaranteed a future request is made on that thread.  It's just kinda weird.  I 
suppose we could purposefully set that {{AUTOMATIC}} after the request is 
complete.  That way it would only last for the life of the request.  That would 
do it......(thinking as i type)...no?

> transaction commit() issue
> --------------------------
>
>                 Key: TINKERPOP3-875
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-875
>             Project: TinkerPop 3
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.0.1-incubating
>            Reporter: Dylan Millikin
>            Assignee: stephen mallette
>
> I'm still experiencing issue with transactions (working my way from the titan 
> bug). The following series of requests to gremlin server fail on the last 
> {{tx().open()}} because of some issue with transaction management.
> I've included all the information I have in the form of the log and the 
> requests. They're all short enough to go through easily.
> I'm also using a 3.0.2 snapshot that outdates the changes that were made to 
> session management (as can be noticed by the last request with an {{op}} of 
> {{close}})
> {{GraphT}} and {{t}} refer to a neo4j graph and it's corresponding traversal.
> Here's the full succession of requests (create two vertices in a transaction, 
> fetch them and delete them in another transaction):
> {code}
> {"requestId":"5d1790dc-5ae0-4926-bc67-8736adbde576","processor":"session","op":"eval","args":{"gremlin":"graphT.tx().open()","session":"bc1c71e5-4122-4829-a349-0c9a8c0df5bd"}}
> {"requestId":"bb0b6981-7d5e-4552-a964-f1b91b08bbe4","processor":"session","op":"eval","args":{"gremlin":"t.addV().property(B_KEY_NAME,B_KEYVALUE_NAME).property(B_KEY_AGE,B_KEYVALUE_AGE)","bindings":{"B_KEY_NAME":"name","B_KEYVALUE_NAME":"john","B_KEY_AGE":"age","B_KEYVALUE_AGE":27},"session":"bc1c71e5-4122-4829-a349-0c9a8c0df5bd"}}
> {"requestId":"37c133ab-195b-43d9-bb6a-c3b6e41e1396","processor":"session","op":"eval","args":{"gremlin":"t.addV().property(B_KEY_NAME,B_KEYVALUE_NAME).property(B_KEY_AGE,B_KEYVALUE_AGE)","bindings":{"B_KEY_NAME":"name","B_KEYVALUE_NAME":"john","B_KEY_AGE":"age","B_KEYVALUE_AGE":27},"session":"bc1c71e5-4122-4829-a349-0c9a8c0df5bd"}}
> {"requestId":"3cf7a392-4090-40a2-bb33-1b89e731cf03","processor":"session","op":"eval","args":{"gremlin":"graphT.tx().commit()","session":"bc1c71e5-4122-4829-a349-0c9a8c0df5bd"}}
> {"requestId":"d641b90e-d746-4c44-87e4-226171a2bb44","processor":"","op":"eval","args":{"gremlin":"t.V(B_R_ID).range(0,1)","bindings":{"B_R_ID":168}}}
> {"requestId":"b22267fb-49a3-4525-aa5c-938a9f7221cf","processor":"","op":"eval","args":{"gremlin":"t.V(B_R_ID).range(0,1)","bindings":{"B_R_ID":162}}}
> // 5 second sleep
> {"requestId":"67512bb9-14ab-42c4-9135-5e279a45fd11","processor":"session","op":"eval","args":{"gremlin":"graphT.tx().open()","session":"bc1c71e5-4122-4829-a349-0c9a8c0df5bd"}}
> {"requestId":"55bbffa2-8bf2-4a2a-971a-c9b2efb9d183","processor":"session","op":"close","args":{"gremlin":"","session":"bc1c71e5-4122-4829-a349-0c9a8c0df5bd"}}
> {code}
> Here's the full server log from start to finish:
> {code}
> [INFO] Session - New session established for 
> bc1c71e5-4122-4829-a349-0c9a8c0df5bd
> [INFO] ScriptEngines - Loaded nashorn ScriptEngine
> [INFO] ScriptEngines - Loaded gremlin-groovy ScriptEngine
> [INFO] GremlinExecutor - Initialized gremlin-groovy ScriptEngine with 
> scripts/gremlin-php-script.groovy
> [WARN] AbstractEvalOpProcessor - Exception processing a script on request 
> [RequestMessage{, requestId=67512bb9-14ab-42c4-9135-5e279a45fd11, op='eval', 
> processor='session', args={gremlin=graphT.tx().open(), 
> session=bc1c71e5-4122-4829-a349-0c9a8c0df5bd}}].
> java.lang.IllegalStateException: Stop the current transaction before opening 
> another
>       at 
> org.apache.tinkerpop.gremlin.structure.Transaction$Exceptions.transactionAlreadyOpen(Transaction.java:139)
>       at 
> org.apache.tinkerpop.gremlin.structure.util.AbstractTransaction.open(AbstractTransaction.java:85)
>       at org.apache.tinkerpop.gremlin.structure.Transaction$open.call(Unknown 
> Source)
>       at Script2.run(Script2.groovy:1)
>       at 
> org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.eval(GremlinGroovyScriptEngine.java:525)
>       at 
> org.apache.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.eval(GremlinGroovyScriptEngine.java:365)
>       at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:233)
>       at 
> org.apache.tinkerpop.gremlin.groovy.engine.ScriptEngines.eval(ScriptEngines.java:96)
>       at 
> org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor.lambda$eval$7(GremlinExecutor.java:244)
>       at 
> org.apache.tinkerpop.gremlin.groovy.engine.GremlinExecutor$$Lambda$110/1114839633.call(Unknown
>  Source)
>       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>       at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>       at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>       at java.lang.Thread.run(Thread.java:745)
> [INFO] Session - Rolling back open transactions on graphT before killing 
> session: bc1c71e5-4122-4829-a349-0c9a8c0df5bd
> [INFO] Session - Session bc1c71e5-4122-4829-a349-0c9a8c0df5bd closed
> {code}
> Any ideas where to start looking?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to