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

ASF GitHub Bot commented on TINKERPOP-3298:
-------------------------------------------

spmallette opened a new pull request, #3728:
URL: https://github.com/apache/tinkerpop/pull/3728

    https://issues.apache.org/jira/browse/TINKERPOP-3298
   
   In TinkerTransactionGraph, an element found through an index, or a reference 
kept across a commit, was the committed element itself rather than a copy 
belonging to the transaction. A write through it changed committed state 
directly: other transactions could see it before commit, rollback didn't undo 
it, and concurrent writers could fail with ArrayIndexOutOfBoundsException.
   
   - Index lookups now return the transaction's own copy, as vertices(id) 
already does.
   - Commit stores a copy of the transaction's version as the committed 
element, so a reference kept by the caller is never committed state.
   - Writing through a kept reference to a vertex or edge deleted since then 
still throws ... was removed, as before.
   
    VOTE +1




> TinkerTransactionGraph writes through an indexed lookup or a kept reference 
> bypass transaction isolation
> --------------------------------------------------------------------------------------------------------
>
>                 Key: TINKERPOP-3298
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP-3298
>             Project: TinkerPop
>          Issue Type: Bug
>          Components: tinkergraph
>    Affects Versions: 3.7.7
>            Reporter: Stephen Mallette
>            Assignee: Stephen Mallette
>            Priority: Critical
>
> An element found through an index, or a reference kept across a commit, was 
> the committed element itself, not a transaction copy. A write through it 
> changed committed state directly:
> - it was visible to other transactions before commit;
> - rollback did not undo it;
> - concurrent writers could fail with ArrayIndexOutOfBoundsException. 
> {code}
> graph.createIndex('name', Vertex.class)
> g.addV().property('name','a').property('weight',1).iterate(); g.tx().commit()
> g.V().has('name','a').property('weight',2).iterate(); g.tx().rollback()
> g.V().has('name','a').values('weight')   // 2, expected 1
> v = g.addV().property('weight',1).next(); g.tx().commit()
> v.property('weight',2); g.tx().rollback()
> g.V(v.id()).values('weight')              // 2, expected 1
> {code} 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to