gremlingraph-databasesgremlin-serverazure-cosmosdb-gremlinapigremlinnet

Why CommitAsync does not complete in Gremlin .NET Transactions


I am having trouble with gremlin .NET

Gremlin server: 3.6.0 Gremlin .NET: 3.6.0

Code:

var gremlinServer = new GremlinServer("localhost", 8182);
ConnectionPoolSettings connectionPoolSettings = new ConnectionPoolSettings()
{
    MaxInProcessPerConnection = 10,
    PoolSize = 30,
    ReconnectionAttempts = 3,
    ReconnectionBaseDelay = TimeSpan.FromMilliseconds(500)
};

var webSocketConfiguration =
    new Action<ClientWebSocketOptions>(options =>
    {
        options.KeepAliveInterval = TimeSpan.FromSeconds(10);
    });


var gremlinClient = new GremlinClient(
    gremlinServer);
var driverRemoteConnection = new DriverRemoteConnection(gremlinClient);
var anonymousTraversalSource = AnonymousTraversalSource.Traversal().WithRemote(driverRemoteConnection);
var remoteTransaction = anonymousTraversalSource.Tx();
var graphTraversalSource = remoteTransaction.Begin();
await graphTraversalSource.AddV("person").Property("name", "jorge").Promise(t => t.Iterate());
await graphTraversalSource.AddV("person").Property("name", "josh").Promise(t => t.Iterate());
await remoteTransaction.CommitAsync().ConfigureAwait(false); // Even without this, vertices are getting created

How I start server: Run "bin\gremlin-server.bat conf\gremlin-server.yaml" on command prompt

Issue: The issue is with "await remoteTransaction.CommitAsync().ConfigureAwait(false);"

  1. Even without this line the vertices are created and I could see it with gremlin console and graphexp enter image description here
  2. This line does not complete, its stuck

Can someone guide on what I am doing incorrect.


Solution

  • CosmosDB does not support newer versions of TinkerPop. You should stick to the 3.4.x line of releases as described in their documentation.