How can I configure NHibernate to not cache a file. I know I can create a method that does an HSQL, but can I through a configuration setting in the .xml file or the hibernate xml file itself to not cache a property?
Thanks in advance.
How can I configure NHibernate to not cache a file. I know I can create a method that does an HSQL, but can I through a configuration setting in the .xml file or the hibernate xml file itself to not cache a property?
Thanks in advance.
You cannot set secondary caching settings at property level (as far as I know), but you can individually tune cache settings for each entity directly in their XML files.
For instance:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="ClassName" table="Table">
<cache usage="nonstrict-read-write" />
<id name="Id" type="Int64" ...
Where the cache "usage" property can be any of the following values: