Ken Hu created TINKERPOP-3226:
---------------------------------

             Summary: GraphManager hasAnyOpenTransactions() doesn't work 
remotely with some graphs
                 Key: TINKERPOP-3226
                 URL: https://issues.apache.org/jira/browse/TINKERPOP-3226
             Project: TinkerPop
          Issue Type: Bug
          Components: server
    Affects Versions: 3.7.5
            Reporter: Ken Hu


This is best demonstrated in a test snippet.
{code:java}
public class RemoteTxTests extends AbstractSessionTxIntegrateTest {
    @Test
    public void shouldShowOpenServerTransactions() throws Exception {
        final Cluster cluster = createCluster();
        final GraphTraversalSource g = 
traversal().withRemote(DriverRemoteConnection.using(cluster));

        final GraphTraversalSource gtx = g.tx().begin();
        gtx.addV("person").iterate();
        
assertTrue(server.getServerGremlinExecutor().getGraphManager().hasAnyOpenTransactions());
 // this fails
        gtx.tx().commit();
        
assertFalse(server.getServerGremlinExecutor().getGraphManager().hasAnyOpenTransactions());

        cluster.close();
    }
}
{code}
TinkerTransactionGraph will incorrectly report that there are no open 
transactions. This is likely because it uses a ThreadLocal variable to 
determine whether there is an open transaction and that gets called from a 
different thread in the server.



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

Reply via email to