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

stephen mallette commented on TINKERPOP-2257:
---------------------------------------------

I think you're right. I guess we need to generate the metadata prior to 
{{commit()}}. Do you want to submit a pull request to fix this? 

> transaction itty  may still be visited after commit
> ---------------------------------------------------
>
>                 Key: TINKERPOP-2257
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-2257
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.4.0
>            Reporter: Stark Arya
>            Priority: Critical
>
> Branch: 3.4.0-rc2 
> File: org.apache.tinkerpop.gremlin.server.op.AbstractOpProcessor.java
> Function: handleIterator
> Wherence:
> {code}
>        // we have an empty iterator - happens on stuff like: g.V().iterate()
>       if (!itty.hasNext()) \{
>       // as there is nothing left to iterate if we are transaction managed 
> then we should execute a
>       // commit here before we send back a NO_CONTENT which implies success
>       if (managedTransactionsForRequest) attemptCommit(msg, 
> context.getGraphManager(), settings.strictTransactionManagement);
>       rhc.writeAndFlush(ResponseMessage.build(msg)
>       .code(ResponseStatusCode.NO_CONTENT)
>       .statusAttributes(generateStatusAttributes(ctx, msg, 
> ResponseStatusCode.NO_CONTENT, itty, settings))
>       .create());
>       return;
>       }
> {code}
> when attemptCommit called, the transaction finished and the itty handle will 
> Invalid,but
> generateStatusAttributes will try to invoke itty.hasNext() again
> this will cause some problems and could recurrent when doing follow testing:
> 1.test data 
> {code}
> g.addV('gdb_sample_person').property(id, 'gdb_sample_marko').property('age', 
> 28).property('name', 'marko') g.addV('gdb_sample_person').property(id, 
> 'gdb_sample_vadas').property('age', 27).property('name', 'vadas') 
> g.addV('gdb_sample_person').property(id, 'gdb_sample_josh').property('age', 
> 32).property('name', 'josh') g.addV('gdb_sample_person').property(id, 
> 'gdb_sample_peter').property('age', 35).property('name', 'peter') 
> g.addV('gdb_sample_software').property(id, 'gdb_sample_lop').property('lang', 
> 'java').property('name', 'lop') g.addV('gdb_sample_software').property(id, 
> 'gdb_sample_ripple').property('lang', 'java').property('name', 'ripple')
> g.addE('gdb_sample_knows').from(V('gdb_sample_marko')).to(V('gdb_sample_vadas')).property('weight',
>  0.5f) 
> g.addE('gdb_sample_knows').from(V('gdb_sample_marko')).to(V('gdb_sample_josh')).property('weight',
>  1.0f) 
> g.addE('gdb_sample_created').from(V('gdb_sample_marko')).to(V('gdb_sample_lop')).property('weight',
>  0.4f) 
> g.addE('gdb_sample_created').from(V('gdb_sample_josh')).to(V('gdb_sample_lop')).property('weight',
>  0.4f) 
> g.addE('gdb_sample_created').from(V('gdb_sample_josh')).to(V('gdb_sample_ripple')).property('weight',
>  1.0f) 
> g.addE('gdb_sample_created').from(V('gdb_sample_peter')).to(V('gdb_sample_lop')).property('weight',
>  0.2f)
> {code}
> 2. test dsl: 
> {{g.V().has("gdb_sample_person","name","marko").out("gdb_sample_knows").barrier().both().count().is(lt(1l))}}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to