Search   

Friday, February 10, 2012

Support » Support Forum

Register  Login

 Menu  
 
    

 Welcome!  
 


Welcome to the NDO support forum!

kreis.gif Please register/login at the site if you want to post a thread. We sometimes copy support mails of common interest to the forum. They appear with anonymous sender.
kreis.gif Please post your messages in English language if possible. You can do your posts also in German, we will translate your post and our answer so that all users of the forum can read your posts.
kreis.gif The forum software requires that javascript is enabled.
kreis.gif Please do not insert licence information or licence keys in forum posts.
kreis.gif If you know a good answer to a post of another user, feel free to reply!
kreis.gif The forum is monitored. We reserve the right to remove posts we consider not to be useful for other forum users.

   Print   

      
 NDO Support Forum  
 
SearchForum Home
  NDO-Forum postings in english please, if possible.  Developing with NDO  OnLoaded Event ...
 OnLoaded Event :IPersistenceNotifiable
 
 10/18/2006 3:45:51 PM
boriska
7 posts


OnLoaded Event :IPersistenceNotifiable
 Modified By boriska  on 10/18/2006 3:50:27 PM)
Hello Mirko, In our application we use 2 different databases, but we load objects only from the first database. Then we have to complete data contained in objects, so we load necessary data from the second db via ADO.NET and add this info to the loaded objects. Hereby we have to consider aggregation relationships between objects and also we have to struggle with recursive constructions etc. In order to simplify this filling process we would use call backs. We thought that object classes can implement IPersistenceNotifiable and object’s onLoad event will call routines that complete filling process for every loaded object. However we asserted that OnLoaded event will be fired every time if we refer to objects properties and not only the first time if the object will be "loaded". Could you tell me if our assumptions about onloaded were wrong. Do you think we can use another workaround to solve our issue? Best regards, Boris
 10/19/2006 3:00:10 PM
Mirko
109 posts
5th


Re: OnLoaded Event :IPersistenceNotifiable
 Modified By Mirko  on 10/19/2006 3:00:37 PM)

Hi Boris,

remember, if you execute a query in hollow mode (which is the default) the objects are loaded at the moment you touch it the first time. That's the moment, where OnLoaded is called by NDO. So, if you set the hollow parameter in the query constructor or NewQuery factory method to false, you'll get the OnLoaded call immediatly at query time.

Best Regards:
Mirko 

 10/19/2006 5:06:59 PM
boriska
7 posts


Re: OnLoaded Event :IPersistenceNotifiable
Hello Mirko, Thank you for your answering. So if I correct understand you, you recommend in this case setting hollow mode off? In order to improve performance we could use transient boolean variable that could be evaluated on Loaded event, so we can perform our logic only first time object was loaded. Best regards, Boris
 10/20/2006 5:28:43 PM
boriska
7 posts


Re: OnLoaded Event :IPersistenceNotifiable
 Modified By boriska  on 10/20/2006 5:39:04 PM)
Hello Mirko, I would pose my next question. It’s relates to my previous posting. NDO caches objects and it’s common to use hollow mode on dealing with objects. So if a user processed an action and closed a form, objects will live in a cache for a while. If this user opens a form with the same object later, all needed data are available. In our scenario we will use onLoaded event to fill objects, but onLoaded wouldn’t be fired, if a hollow object lives in a cache. Is it correct? Don’t we have to worry about concurrency issues if another user changed some data in between? We could use CleanupCache or UnloadCache. The CleanupCache call removes all unused entries from the cache.Could you please explain me what does “unused” mean? Best regards, Boris
  NDO-Forum postings in english please, if possible.  Developing with NDO  OnLoaded Event ...
  SearchSearch  Forum HomeForum Home