-->
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: Help with Session Cache
PostPosted: Mon May 04, 2009 6:16 pm 
Newbie

Joined: Mon May 04, 2009 5:47 pm
Posts: 2
Using nHibernate 1.2

Issue: Trying to figure out how the 'session' cache works.

Form 1: 'Search Form' - Users select criteria from drop down boxes, click 'Search' and results appear in grid. IBindingList wrapping nhibernate objects. I am forced to call 'Session.clear' every time I click filter so that database updates are reflected in my results. I am using 'session.CreateCriteria'. [Results is an ArrayList of my objects] I have tried Results.Clear and Results = Nothing but still am forced to use session.clear to see database updates.

Form 2: 'Create Object Form' - Users key in object properties from text boxes / numeric boxes and drop downs. When you click save the object checks to see if there are any other objects in the database the have the same values for certain properties (this is NOT a PK lookup and these are not DB Constraints). This 'validate' routine always seems to find the database updates. I am also using 'session.CreateCriteria' to search the database for 'similar/conflicting' objects.

Question: I am trying to understand why one use of (session.CreateCriteria).List() 'sees' the database updates and the other does not. I imagine it has to do with scoping but I cannot find a firm answer. There are like 50 million articles on second level cache but I haven't been able to find any exhaustive articles on first level cache.


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.