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: Second-level Cache questions
PostPosted: Wed Dec 07, 2005 7:59 am 
Newbie

Joined: Fri Dec 02, 2005 12:08 am
Posts: 12
1. How to work first-level cache? I`m in one session execute identical query
Code:
ICriteria cr = session.CreateCriteria(typeof(Bus)).SetCacheable(true);
, but in MSSQL evry time execute many queryes.
2. How add in NHibernate configuration second-level cache. I have all need DLL`s. In help say To tells which cache provider to use, add in your NHibernate configuration file (can be YourAssembly.exe.config or web.config or a .cfg.xml file):

<add key="hibernate.cache.provider_class" value="XXX" />(1)
<add key="relativeExpiration" value="120" />(2)
but it`s not work.[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 07, 2005 11:47 am 
Contributor
Contributor

Joined: Thu May 12, 2005 9:45 am
Posts: 593
Location: nhibernate.org
1. It is the Query Cache...
2. What doesn't work?

You may read this: Hibernate: Truly Understanding the Second-Level and Query Caches

_________________
Pierre Henri Kuaté.
Get NHibernate in Action Now!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 08, 2005 1:47 am 
Newbie

Joined: Fri Dec 02, 2005 12:08 am
Posts: 12
Thanks it`s very cool reference. My problem with the second-level cache:
1. I can`t attach second-level in my prodject? if paste this strings
<add key="hibernate.cache.provider_class" value="XXX" />(1)
<add key="relativeExpiration" value="120" />
in the hibernate.cfg.xml, im recive Exseption
System.ApplicationException problem parsing configuration : System.Xml.Schema.XmlSchemaException: The element 'urn:nhibernate-configuration-2.0:hibernate-configuration' has invalid child element 'urn:nhibernate-configuration-2.0:add'. An error occurred at file:///C:/nHibernate/TestC#/GarageManager/bin/Debug/hibernate.cfg.xml, (16, 3). what`s wrong?
2. How correctly attach second-level?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 08, 2005 6:05 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Use this syntax:
Code:
<property name="...">value goes here</property>


Also, you have to enable the query cache by setting hibernate.cache.use_query_cache to true.


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.