Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error SqliteConnection #1

Open
MacKey-255 opened this issue Apr 17, 2021 · 0 comments
Open

Error SqliteConnection #1

MacKey-255 opened this issue Apr 17, 2021 · 0 comments

Comments

@MacKey-255
Copy link

I'm have a problem when I try to use DbContext.SaveChanges() concurrently. It basically throws me this error:

System.InvalidOperationException: SqliteConnection does not support nested transactions.
   en Microsoft.Data.Sqlite.SqliteConnection.BeginTransaction(IsolationLevel isolationLevel)
   en Microsoft.Data.Sqlite.SqliteConnection.BeginDbTransaction(IsolationLevel isolationLevel)
   en System.Data.Common.DbConnection.BeginTransaction(IsolationLevel isolationLevel)
   en Microsoft.EntityFrameworkCore.Storage.RelationalConnection.BeginTransaction(IsolationLevel isolationLevel)
   en Microsoft.EntityFrameworkCore.Storage.RelationalConnection.BeginTransaction()
   en Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(IEnumerable`1 commandBatches, IRelationalConnection connection)
   en Microsoft.EntityFrameworkCore.Storage.RelationalDatabase.SaveChanges(IList`1 entries)
   en Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(IList`1 entriesToSave)
   en Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(DbContext _, Boolean acceptAllChangesOnSuccess)
   en Microsoft.EntityFrameworkCore.Storage.Internal.NoopExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
   en Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(Boolean acceptAllChangesOnSuccess)
   en Microsoft.EntityFrameworkCore.DbContext.SaveChanges(Boolean acceptAllChangesOnSuccess)
   en Microsoft.EntityFrameworkCore.DbContext.SaveChanges()

I have a single connection which is shared by each DbContext created by request. Everything works fine when it comes to reading information but in writing it throws me the error: SqliteConnection does not support nested transactions. What can i do to fix it?
SAlu2s

Further technical details

Microsoft.EntityFrameworkCore 3.1.14
Microsoft.EntityFrameworkCore.Design 3.1.14
Microsoft.EntityFrameworkCore.Sqlite.Core 3.1.14
SQLitePCLRaw.bundle_e_sqlcipher 2.0.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant