Refetch = false seems not to work on collections

Posts   
 
    
Meindert
User
Posts: 63
Joined: 07-Nov-2012
# Posted on: 06-Apr-2020 10:42:09   

LLBLGen 5.1.1 DB: MSSQL

Hello, I write to a view, the instead trigger of the view desides if a entity should be deleted. From de client view I have only new en dirty entities.

In case the entity is deleted by the view than I call adapter.SaveEntity(aEntity, false, false); This works for a single entity.

To have better perfomance I like to use adapter.SaveEntityCollection(aEntityCollection, false, false);

When I call this function a got an exception: ex = {"An exception was caught during the execution of an action query: ....}

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 06-Apr-2020 12:11:57   

Why omit the stacktrace? simple_smile A message like that is useless, sorry, like you know as a developer wink . Give the full stacktrace, and also check whether some queries are generated/executed already or that it fails on the first query.

Refetch of the entity isn't done when the flag is false. SaveEntityCollection creates a unit of work and adds the collection to that with the flag specified (so false), and this flag is added to all workqueue items for the entities in the collection, and the flag in the workqueue item is then used to determine if the refetch should be taken after the insert.

I have the feeling the issue is caused by something else but without a stacktrace it's impossible to determine where to begin looking

Frans Bouma | Lead developer LLBLGen Pro
Meindert
User
Posts: 63
Joined: 07-Nov-2012
# Posted on: 06-Apr-2020 14:17:47   

Sorry for the fuss, it turned out that the instead trigger was the problem.