Created object for gremlinServer , connectionPoolSettings
var gremlinClient = new GremlinClient(gremlinServer,connectionPoolSettings:connectionPoolSettings);
using (gremlinClient)
{
var v1 = graph.AddV("person").Property("name", "marko").Next();**
var v2 = graph.AddV("person").Property("name", "stephen").Next();
graph.V(v1).AddE("knows").To(v2).Property("weight", 0.75).Iterate();
}
At var V1 getting below exception:
Gremlin.Net.Driver.Exceptions.ConnectionClosedException: 'Connection closed by server. CloseStatus: InternalServerError, CloseDescription: Internal-Server-Error. Any in-progress requests on the connection will be in an unknown state, and may need to be retried.
I am not able to understand why the server is closing connection
After you call
Next()the first time thatv1object is now a result. Isgraphthe actual GraphTraversalSource, or something you spawned from it? If the latter, after the call toNextit has been completed and you will have to create it again.In general, it would be better to have the first two calls that populate v1 and v2 return their IDs. Even better, do it all as one query. I will show examples of both below.
or, cleaner,
I also assume that
graphis aGraphTraversalSourceobject (commonly calledg, and not an actualGraphobject of something spawned fromg.