Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query does not return results after nested transaction committed #1373

Open
ifedan opened this issue Feb 15, 2017 · 0 comments
Open

Query does not return results after nested transaction committed #1373

ifedan opened this issue Feb 15, 2017 · 0 comments

Comments

@ifedan
Copy link

ifedan commented Feb 15, 2017

Cannot get any results after nested transaction was executed.

Transaction outer = graph.tx();

//Try to find vertex that does not exist
//There is an index exists on propName
GraphTraversal<Vertex, Vertex> traversal = graph.traversal().V().has(label, propName, propValue);
if (traversal.hasNext()) {
        return;
}

//Add vertex in nested transaction
TitanTransaction inner = graph.newTransaction();
inner.addVertex(T.label, label, propName, propValue);
inner.commit();

boolean stored = graph.traversal().V().has(label, propName, propValue).hasNext();
if (!stored) {
      //ERROR: Can't get added vertex
}
stored = graph.traversal().V().has(label, propName, propValue).limit(1).hasNext();
assert stored != null;

outer.commit();

The problem exists because of an indexCache inside StandardTitanTx that cached previous result.

@ifedan ifedan changed the title Query does not return results after nested transaction commit Query does not return results after nested transaction committed Feb 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant