Base solution for your next web application
Open Closed

automatic update sql statement is executing in framework #1589


User avatar
0
iamnish created

its kind of weird whenever i inquire my table it will automatically pass a sql update statement to update the invdt and invduedt . it will pass the sql update statement For all the records fetched.

what i noticed is that statement is executed when data is passed from saleappservice to the controller

return new ListResultOutput<Salemastdto>(saledtos);

below statement is from sqlprofiler

exec sp_executesql N'UPDATE [dbo].[Sale_Mast] SET [Invdt] = @0, [Invduedt] = @1, [LastModificationTime] = @2, [LastModifierUserId] = @3, [CreationTime] = @4 WHERE (([TenantId] = @5) AND ([Invno] = @6)) ',N'@0 datetime2(7),@1 datetime2(7),@2 datetime2(7),@3 bigint,@4 datetime2(7),@5 int,@6 nvarchar(50)',@0='2016-07-14 00:00:00',@1='2016-07-17 00:00:00',@2='2016-08-27 15:01:59.7960039',@3=3,@4='2016-07-14 12:38:15.5270000',@5=2,@6=N'099'


3 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    Which version of Abp and Ebp.EntityFramework packages are you using? As I remember, there was a related bug in old versions.

  • User Avatar
    0
    iamnish created

    both are 0.9.1.0

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    I think your problem is related to this issue <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1058">https://github.com/aspnetboilerplate/as ... ssues/1058</a>. Since we change entityState while retrieving an entity, it causes the updatae query to run.

    Upgrading abp packages to 0.9.1.1 or a higher version should solve the problem.