Calling entity methods on SaveChanges.

Thread is closed for posting
2 posts, 0 answers
  1. Daniel
    Daniel avatar
    1 posts
    Member since:
    Aug 2013

    Posted 26 Sep 2014 Link to this post


    Is there any workaround for simulating PostStore functionality? Calling method before the transaction is commited to the database.
    Does InitializeTransients with InitOperation.Hollow is called after saving the object ?
    Is it intended PreStore to be called only when the entity is dirty?
    If so is there a way to call entity method every time SaveChanges is invoked in the context of one transaction?
    What is the earliest point after transaction is started where I can intercept the saving process?
    There is InstanceLifecycleListener interface, which seems can handle save process interception. Can I attach it somewhere and if yes where?

    Daniel Tsviatkov
  2. Thomas
    Thomas avatar
    590 posts

    Posted 30 Sep 2014 Link to this post

    Hi Daniel,

    yes, the IInstanceCallbacks interface is intended to be implemented by your persistent classes. See here in the older documentation : . The methods are found and called by our runtime.

    The more modern approach is to use the approach as outlined here:

    If you need to ensure consistency in the context on a logical level, you should consider overriding SaveChanges() so that the consistency is made above the OpenAccess runtime. This way you control the order of execution more easily.

    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
Back to Top