Hi, I am trying to run Unit test cases, but i am getting following error.
Message: System.InvalidOperationException : SqliteConnection does not support nested transactions.
Stack Trace:
SqliteConnection.BeginTransaction(IsolationLevel isolationLevel, Boolean deferred)
SqliteConnection.BeginTransaction(IsolationLevel isolationLevel)
SqliteConnection.BeginDbTransaction(IsolationLevel isolationLevel)
DbConnection.BeginTransaction(IsolationLevel isolationLevel)
RelationalConnection.BeginTransaction(IsolationLevel isolationLevel)
RelationalConnection.BeginTransaction()
DatabaseFacade.BeginTransaction()
UnitOfWorkDbContextProvider1.CreateDbContextWithTransaction(IUnitOfWork unitOfWork) UnitOfWorkDbContextProvider
1.CreateDbContext(IUnitOfWork unitOfWork)
UnitOfWorkDbContextProvider1.CreateDbContext(IUnitOfWork unitOfWork, String connectionStringName, String connectionString) <44 more frames...> CastleAsyncAbpInterceptorAdapter
1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) CastleAbpMethodInvocationAdapterWithReturnValue
1.ProceedAsync()
UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func
3 proceed)
<<GetInvoiceByStatusAsync>b__0>d.MoveNext() line 256
--- End of stack trace from previous location ---
InvoiceManagementTestBase1.WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func
1 action) line 33
InvoiceApplicationTests.GetInvoiceByStatusAsync() line 254
--- End of stack trace from previous location ---~~~~
what i am missing?
If you're creating a bug/problem report, please include followings:
- ABP Framework version: v4.3.1
- UI type: Angular
- DB provider: EF Core
- Tiered (MVC) or Identity Server Separated (Angular): yes
- Exception message and stack trace:
- Steps to reproduce the issue:"
2 Answer(s)
-
0
hi
SqliteConnection does not support nested transactions.
You can disable the transaction in unit test, This is a limitation of sqlite, we can only do this.
Configure<AbpUnitOfWorkDefaultOptions>(options => { options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled; });
-
0
@maliming,
I tried with this, but yet issue not fixed.