Open mcalvin-kinectify opened 2 years ago
Here is the exception I am receiving:
I was able to get a successful connection by doing this:
services.AddScoped(context =>
{
var path = config.GetValue<string>("Neo4j:Path");
return GraphDatabase.Driver(path, AuthTokens.Basic(config.GetValue<string>("Neo4j:User"),
config.GetValue<string>("Neo4j:Password")));
});
services.AddScoped<IBoltGraphClient>(x =>
{
var driver = x.GetService<IDriver>();
return new BoltGraphClient(driver);
});
and then injecting IBoltGraphClient
instead of IGraphClientFactory
. Unfortunately, if the BoltGraphClient gets disposed, the underlying driver is disposed also. So it doesn't look like I can reuse the GraphDatabase.Driver
and have to register it as Scoped instead of a Singleton.
I have run into the same issue working with Aura DB.
@mcalvin-kinectify for my understanding/curiosity, the issue with a Scoped lifetime is that you have to call BoltGraphClient.ConnectAsync
with each connection, right?
Hello, We have been using this client on a local neo4j instance and have upgraded to Neo4j's hosted Aura database instead. Aura appears to only support the neo4j+s bolt protocol, and I am getting a messages that the protocol is not supported by Neo4jClient. Is that correct and the client won't work with Aura or am I doing something wrong? Here is how I am injecting the client into the dependency injection container: