Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > Bugs & Issues> Detect if an entity has been deleted in a transaction already
 

Pages: 1
Bugs & Issues
Detect if an entity has been deleted in a transaction already
Page:1/1 

  Print all messages in this thread  
Poster Message
scotru
User



Location:
College Place, WA
Joined on:
16-Feb-2006 01:03:42
Posted:
104 posts
# Posted on: 27-Jan-2015 10:10:56.  
Is there a way to determine if an entity has been deleted earlier in a transaction to avoid updating it? I have a transaction failing with: "During "a save action, an entity's update action failed." Because I've already deleted the entity. I'd like to check if the entity has been deleted in the transaction before adding the update to the transaction.
  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14588 posts
# Posted on: 27-Jan-2015 22:22:46.  
I recommend using Unit of Work

Quote:
It executes the actions added to it in the following order: CallBacks for the PreEntityInsert slot, Inserts, CallBacks for the PreEntityUpdate slot, Updates, UpdateEntitiesDirectly calls, CallBacks for the PreEntityDelete slot, Deletes, CallBacks for the PostEntityDelete slot, DeleteEntitiesDirectly calls. This order can be too limited, for example if you first have to delete an entity before a new insert can take place because the entity to insert has the same value for a field with a unique constraint.

LLBLGen Pro lets you define entity oriented actions to be ordered in a different order.


  Top
scotru
User



Location:
College Place, WA
Joined on:
16-Feb-2006 01:03:42
Posted:
104 posts
# Posted on: 27-Jan-2015 22:34:17.  
That would indeed be a great solution. Sadly, I'm using an older version of Llblgen on a legacy codebase that doesn't support unit of work. Any way just to determine if a delete is pending on the entity in the transaction? I can easily determine if the entity is in the transaction--but can't seem to tell if it's being deleted.
  Top
daelmo
Support Team



Location:
Guatemala City
Joined on:
28-Nov-2005 23:35:24
Posted:
8110 posts
# Posted on: 28-Jan-2015 07:11:02.  
- What 'older' LLBLGen version are you using?
- Are you using Adapter or SelfServicing?
- On what context do you need this? Don't you know by the flow of the code if some entity has already been deleted?


David Elizondo
LLBLGen'ing (articles and code snippets) | linkedin | twitter
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.