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

Daniel Kuppitz commented on TINKERPOP-810:
------------------------------------------

I honestly don't know why, but the inner traversals are not aware of 
sideeffects of the outer traversal. However, the outer traversal is aware of 
sideeffects created by the inner traversals. Hence there's a pretty simple fix:

{code}
g.V().until(or(values('name').is('marko').store('x'),
               select('x'))).repeat(both()).count()
{code}

> store not visible
> -----------------
>
>                 Key: TINKERPOP-810
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-810
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.0.2-incubating
>            Reporter: Matt Frantz
>            Assignee: Daniel Kuppitz
>
> In the following traversal, I can see (via the println) that the {{store}} 
> executes, but the {{select}} inside the {{until}} does not seem to see it.  
> The result is an infinite loop.
> {noformat}
> g = TinkerFactory.createModern().traversal();
> g.V().until(
>     or(values('name').is('marko'),
>        sideEffect{it ->
>            System.err.println('until:' + it.get());
>            System.err.println(it.getClass().getSimpleName());
>            System.err.println(it.getSideEffects());
>        }
>        .select('x'))).
> repeat(both()).
> store('x').
> sideEffect{it ->
>     System.err.println('done:' + it.get());
>     System.err.println(it.getSideEffects());
>     System.err.println(it.getSideEffects().get('x'));
> }.
> count()
> {noformat}
> Here are the first few lines of output:
> {noformat}
> done:v[1]
> sideEffects[size:1]
> Optional[{v[1]=1}]
> until:v[2]
> B_O_S_SE_SL_Traverser
> sideEffects[size:0]
> done:v[1]
> sideEffects[size:1]
> Optional[{v[1]=2}]
> until:v[3]
> B_O_S_SE_SL_Traverser
> sideEffects[size:0]
> done:v[1]
> sideEffects[size:1]
> Optional[{v[1]=3}]
> ...
> {noformat}



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

Reply via email to