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.  [ 4 posts ] 
Author Message
 Post subject: [Solved] Store object only on db, not in memory
PostPosted: Tue Mar 09, 2010 11:12 am 
Newbie

Joined: Tue Mar 09, 2010 10:53 am
Posts: 3
Hello,

I'm using NHibernate in a software which keep states of "electrical" point took at different time of days.
I have an object "point" that contains a collection of object "pointArchive". This collection become extremely large.
I successfully use NHibernate.

My probleme is that storing in database is working fine. But while it's storing in database thanks to NHibernate, this collection took more and more place in memory.

I'd like to know how can I do that this collection is only saved on database (or partially) ? Is there someway to tell to NHibernate to keep object only on database? Or peraps something similar to lazy loading when equal to true?
Do someone has work on similar project or problem?

I don't know if my question is clear enough. Sorry if not.

Thanks for your help.
Christophe.


Last edited by chddv on Mon Mar 22, 2010 6:16 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Store object only on db, not in memory
PostPosted: Wed Mar 10, 2010 8:39 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
In Hibernate there exists the annotation

Quote:
@org.hibernate.annotations.LazyCollection (LazyCollectionOption.EXTRA)


and with this I resolved similar problem.
But I don't know if there already exists analog annotation for NHibernate.


Top
 Profile  
 
 Post subject: Re: Store object only on db, not in memory
PostPosted: Mon Mar 15, 2010 5:22 am 
Newbie

Joined: Tue Mar 09, 2010 10:53 am
Posts: 3
Hi pb00067,

In NHibernate, lazy is true/false value.
Don't know why.

I''ll continue my search.
Thanks for your answer.

Christophe.


Top
 Profile  
 
 Post subject: [Solve] Store object only on db, not in memory
PostPosted: Mon Mar 22, 2010 6:14 am 
Newbie

Joined: Tue Mar 09, 2010 10:53 am
Posts: 3
Hello,

So, I solve my problem by make it in an other way.
I have remove my collection of object "pointArchive".

I only keep a "link" to the last pointArchive.

Thanks for your help.
Christophe.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.