-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Object identity problem
PostPosted: Wed Jan 14, 2009 7:13 am 
Newbie

Joined: Wed Jan 14, 2009 6:45 am
Posts: 6
Dear All,

We are developing an rich-client application using NHibernate and have following problem.

We have a catalog of products which is loaded at application startup in a session. Orders have OrderLines which refer to such products. Certain properties of the Product (such as its name) are bound to widgets in our gui. If, at a later stage, we load a number of Orders in another session, the products they refer to will be duplicates of the products in the catalog. This means that, whenever we change the name of a product in the catalog, the gui is not updated since our orders refer to the duplicate Product, which is left untouched.

We do not immediately see a good solution for this.

One way would be to use only one session in our entire application, but that practice is strongly discouraged in most sites/manuals/fora and is likely to lead to memory leaks.

Another technique would be to implement object-caching ourselves outside of nhibernate and replacing the newly created products (as a result of a cascade) by the already existing product instance. Implementing this would require use of interceptors, but the interceptors do not seem to trigger in a findAll operation (only in a findById).

Any help would be very welcome,

Kind regards,
Yves


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.