-->
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.  [ 2 posts ] 
Author Message
 Post subject: Trouble with Many-to-one mapping
PostPosted: Tue Nov 28, 2006 10:26 am 
Newbie

Joined: Tue Oct 24, 2006 9:10 am
Posts: 17
Hello, I'm using NHibernate 1.0.2 with Oracle 10.

This is my trouble:

I persisted an object with his relationships and then got this object with an method that is validated(I tested in another page, so the mapping and methods are ok).

It returned me the same object I've just persisted(where the entity has just the id of the other entities on his relationship). By the way the log did not generate the sql commands. So it assumed that the object was just cached in the session and it returned the same to me without going to the database.

To solve the problem I had to get the object in another http request to load it with the relationships populated it has to be.

How can I force it to load from the database, with the relation objects completely populated?


Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 28, 2006 11:04 am 
Expert
Expert

Joined: Thu Jan 19, 2006 4:29 pm
Posts: 348
You can use Session.Evict to remove object from cache.

Gert

_________________
If a reply helps You, rate it!


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

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.