Neo4j driver #835
Unanswered
killJoy-03
asked this question in
Q&A
Replies: 1 comment
-
Hi killJoy-03. Your usage of the session object and ExecuteRead method look correct. One thing to keep in mind is that behind the scenes when you call Note: if you are not batching multiple queries into a single transaction then it is also worth considering the ExecuteQuery interface on the driver object, less code and simpler to use. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am working on a project(.NET).
In this, we are only having read queries.
Recently we have observed our project uses maximum Memory at a certain point and gets stuck. (and memory usage is not decreasing).
So I just want to ensure we are not using neo4j driver wrong.
coreDriver is Singleton.
protected virtual IAsyncSession NewSession => coreDriver.AsyncSession(p => p.WithDefaultAccessMode(AccessMode.Read));
public async Task<IReadOnlyList<T>> ExecuteReadAsync<T>(string query, OneOf<object, IDictionary<string, object?>> parameters) where T : new() { using var session = NewSession; var res = await session.ExecuteReadAsync(async tx => { var cursor = await tx.RunAsync(query, GetOneOfValue(parameters)).ConfigureAwait(false); var res = await cursor.ToListAsync<T>().ConfigureAwait(false); return res; }).ConfigureAwait(false); return res; }
Beta Was this translation helpful? Give feedback.
All reactions