Logical deletion in OpenAccess

Thread is closed for posting
2 posts, 1 answers
  1. James Denning
    James Denning avatar
    24 posts
    Member since:
    Apr 2009

    Posted 08 May 2009 Link to this post

    Hi there
    Are there any recommended approaches for implementing logical deletion in a forward-mapped OpenAccess-based application? By this i mean the data is no longer visible to the ORM layer but is still within the database. Only current thinking I have come up with is to serialize the data to a database recycle bin table by handling the deleting event but this is far from ideal.
    James Denning
    PS OpenAccess is awesome btw :)
  2. Answer
    PetarP avatar
    754 posts

    Posted 11 May 2009 Link to this post

    Hi James Denning,
    on of the ways is to have an additional bool field to every table that will indicate whether the object is logically deleted or not and than filter on that field. However using this approach wont actually hide the objects because they would still be read from the database and than filtered. In addition things might get really complicated if there are deleted references as well.
    The other possible approach is to have all the tables copied with a _deleted suffix and when ever the deleting event is fired the objects should be moved to the corresponding tables rather then being deleted.

    Best wishes,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top