Open Closed

Could not save changes because the target table has database triggers #6470


User avatar
0
jayesh@extranerds.com created
  • ABP Framework version: v8.0.0

  • UI Type: Blazor WASM

  • Database System: EF Core (SQL Server,sqlite..) /

  • Tiered (for MVC) or Auth Server Separated (for Angular): no

  • Exception message and full stack trace:

  • SET IMPLICIT_TRANSACTIONS OFF; SET ON; INSERT INTO NOCOUNT[AppInspectionTypes] ([Id], [ConcurrencyStamp], [CreationTime], [CreatorId], [DeleterId], [DeletionTime], [Description], [IsActive], [IsDefault], [LastModificationTime], [LastModifierId], [Name], [TenantId]) OUTPUT INSERTED.[IsDeleted] VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9, @p10, @p11, @p12); 2024-01-08 20:28:39.930 +05:30 [ERR] An exception occurred in the database while saving changes for context type 'APro.Inspector.EntityFrameworkCore.InspectorDbContext'. Microsoft.EntityFrameworkCore.DbUpdateException: Could not save changes because the target table has database triggers. Please configure your table accordingly, see https://aka.ms/efcore-docs-sqlserver-save-changes-and-output-clause for more information. ---> Microsoft.Data.SqlClient.SqlException (0x80131904): The target table 'AppInspectionTypes' of the DML statement cannot have any enabled triggers if the statement contains an OUTPUT clause without INTO clause. at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) ClientConnectionId:43b27918-2f8f-49c7-8873-6b6c08103716 Error Number:334,State:1,Class:16

  • Steps to reproduce the issue:

  • When I am trying to use the create entity using my old code that was generated through abp suite 7.2 is giving internal server error after upgrading the code to abp 8


1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Can you check this workaround?

    https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-7.0/breaking-changes?tabs=v7#sqlserver-tables-with-triggers

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11