How does the default implementation of dbcontext in EF core handle the connections for multiple sequential queries within same scope, when the scope is not wrapped within a transaction?
E.G.
- Query some data.
- Do some math
- Query more data
- Do more math
- return the result
Wrapping the scope in a transaction should force it to use the same connection. Is the same behavior also applied without a transaction?
The best explanation I have found so far is here: "Working with DbContext", heading "Connections". This does not explicitly state, what the exact behaviour is, but from "reading between the lines" I understand that one query = one connection from the pool and after calling the execution method (e.g. ToListAsync, FirstAsync, etc.) the connection is returned to the pool right away.
Is my understanding correct or am I missing something?