-->
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: H. perform sql query all the time - performance problem
PostPosted: Fri Feb 09, 2007 12:39 pm 
Newbie

Joined: Fri Jul 28, 2006 4:32 am
Posts: 9
Lo,
everytime when I call select hibernate query (via CreateQuery(select...etc.) ) my apl start to perform SQL query over the db. It would be ok if the data in db would be changed, but if they don't I need my apl to read these data from memory (apl -> DataTable -> DataAdapter -> DB style) due performance issue. I guess Hibernate should can do this. Probably there is some construction in my code which brake this function. Do you know appropriate way how to use Hibernate to reach this functionality?

Thanks a lot for your response...


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 09, 2007 2:28 pm 
Contributor
Contributor

Joined: Sat Sep 24, 2005 11:25 am
Posts: 198
If I understand you correctly, you want NHibernate to not call the database every time you issue the same query.
NHibernate has support for this via query caching.
This requires three things:
1/ enable the second level cache
2/ enable query caching
3/ on a query that you want to be cache, call SetCachable(true)


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.