Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
11-17-2019 02:21 PM
Hi there
I'm looking for examples for connecting a .NET Core 2.2 Web.api to a brand new sparkling Neo4j Aura instance. I Figure I need the alpha driver ( 4.0.0-alpha01) as it targets .NET Standard 2, but I am struggeling in finding any tutorials or examples. Something to get me started. I keep getting this Error message: Failed after retried for 6 times in 30000 ms. Make sure that your database is online and retry again.
11-18-2019 09:37 PM
Almost sounds like maybe it's a networking error, not so much a .Net error. Have you double checked that it's network accessible and the instance allows non-local connections?
11-19-2019 12:45 PM
I suspect I'm not connecting correctly, however I don't quite know what else to try. Any help would be greatly appriciated. I am able to connect to the db through Neo4jDesktop only if I tick the "Use encrypted connection". Does that correspond to any specific setting in the driver?
Startup.cs:
public void ConfigureServices(IServiceCollection services)
{
string uri = "neo4j://904d2222.databases.neo4j.io";
string username = "neo4j";
string password = "seeeeeeecret";
services.AddCors();
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
services.AddSingleton(GraphDatabase.Driver(uri, AuthTokens.Basic(username, password)));
}
Controller:
private async Task<string> Neo4JTestAsync()
{
string db = "MyDb";
string message = "TESTMEDDELANDE";
IAsyncSession session = _driver.AsyncSession(o => o.WithDatabase(db));
try
{
var greeting = session.WriteTransactionAsync(async tx =>
{
var result = tx.RunAsync("CREATE (a:Greeting) " +
"SET a.message = $message " +
"RETURN a.message + ', from node ' + id(a)",
new { message });
var res = await result;
return "return something eventually";
});
return await greeting;
}
catch (Exception e)
{
return e.Message; // throws "Failed after retried for 6 times in 30000 ms. Make sure that your database is online and retry again"
}
finally
{
await session.CloseAsync();
}
}
12-08-2019 12:52 PM
No its resolved by doing two things.
All the sessions of the conference are now available online