Result is that DbConnections are never returned to the connection pool causing connection pool exhaustion.
Situation when disposing the DbContext with Devart.Data.Oracle.EFCore:
Situation when disposing the DbContext with Microsoft.EntityFrameworkCore.SqlServer:
Can you confirm this is a bug?
Sample code:
Code: Select all
using (var scope = new TransactionScope(
TransactionScopeOption.Required,
new TransactionOptions {IsolationLevel = IsolationLevel.ReadCommitted},
TransactionScopeAsyncFlowOption.Enabled))
{
using (var context = new BloggingContext())
{
var blog = new Blog
{
Url = "http://www.foo.bar",
Posts = new List<Post>
{
new Post {Title = "Test", Content = "The content"}
}
};
context.Add(blog);
context.SaveChanges();
scope.Complete();
} // <-- DbConnection is never closed and returned to the connection pool when BloggingContext gets disposed
}