|
9 | 9 | <title>NHibernate.Caches namespace contains several second-level cache providers for NHibernate.</title>
|
10 | 10 |
|
11 | 11 | <para>
|
12 |
| - A cache is place where entities are kept after being loaded from the database; once cached, they can be |
| 12 | + A cache is a place where entities are kept after being loaded from the database; once cached, they can be |
13 | 13 | retrieved without going to the database. This means that they are faster to (re)load.
|
14 | 14 | </para>
|
15 | 15 |
|
|
35 | 35 | the same entity without hitting the database each time; hence the performance gain.
|
36 | 36 | </para>
|
37 | 37 |
|
| 38 | + <para> |
| 39 | + Depending on the chosen cache provider, the second level cache may be actually shared between different session |
| 40 | + factories. If you need to avoid this for some session factories, configure each of them with a different |
| 41 | + <literal>cache.region_prefix</literal>. See <xref linkend="configuration-optional" />. |
| 42 | + </para> |
| 43 | + |
38 | 44 | <para>
|
39 | 45 | Several cache providers have been contributed by NHibernate users:
|
40 | 46 | <variablelist>
|
|
45 | 51 | Uses <classname>Bamboo.Prevalence</classname> as the cache provider. Open the
|
46 | 52 | file <filename>Bamboo.Prevalence.license.txt</filename> for more information about its license;
|
47 | 53 | you can also visit its <ulink url="http://bbooprevalence.sourceforge.net/">website</ulink>.
|
| 54 | + Also see <xref linkend="NHibernate.Caches.Prevalence" />. |
48 | 55 | </para>
|
49 | 56 | </listitem>
|
50 | 57 | </varlistentry>
|
|
55 | 62 | Uses <classname>System.Web.Caching.Cache</classname> as the cache provider. This means that you can
|
56 | 63 | rely on ASP.NET caching feature to understand how it works. For more information, read (on the MSDN):
|
57 | 64 | <ulink url="https://msdn.microsoft.com/en-us/library/6hbbsfk6.aspx">Caching Application Data</ulink>.
|
| 65 | + Also see <xref linkend="NHibernate.Caches.SysCache" />. |
58 | 66 | </para>
|
59 | 67 | </listitem>
|
60 | 68 | </varlistentry>
|
|
69 | 77 | <para>
|
70 | 78 | SysCache2 requires Microsoft SQL Server 2000 or higher.
|
71 | 79 | </para>
|
| 80 | + <para> |
| 81 | + See <xref linkend="NHibernate.Caches.SysCache2" />. |
| 82 | + </para> |
72 | 83 | </listitem>
|
73 | 84 | </varlistentry>
|
74 | 85 | <varlistentry>
|
75 |
| - <term><classname>NHibernate.Caches.MemCache</classname></term> |
| 86 | + <term><classname>NHibernate.Caches.EnyimMemcached</classname></term> |
76 | 87 | <listitem>
|
77 | 88 | <para>
|
78 |
| - Uses <literal>memcached</literal>. See <ulink url="https://memcached.org/">memcached homepage</ulink> |
79 |
| - for more information. |
| 89 | + Uses <literal>Memcached</literal>. See <ulink url="https://memcached.org/">memcached homepage</ulink> |
| 90 | + for more information on Memcached. Also see <xref linkend="NHibernate.Caches.EnyimMemcached" />. |
80 | 91 | </para>
|
81 | 92 | </listitem>
|
82 | 93 | </varlistentry>
|
|
96 | 107 | <listitem>
|
97 | 108 | <para>
|
98 | 109 | Uses <classname>System.Runtime.Caching.MemoryCache.Default</classname> as the cache provider.
|
| 110 | + See <xref linkend="NHibernate.Caches.RtMemoryCache" />. |
99 | 111 | </para>
|
100 | 112 | </listitem>
|
101 | 113 | </varlistentry>
|
|
111 | 123 | <itemizedlist>
|
112 | 124 | <listitem>
|
113 | 125 | <para>
|
114 |
| - Choose the cache provider you want to use and copy its assembly in your assemblies directory |
115 |
| - (<filename>NHibernate.Caches.Prevalence.dll</filename> or |
116 |
| - <filename>NHibernate.Caches.SysCache.dll</filename>). |
| 126 | + Choose the cache provider you want to use and copy its assembly in your assemblies directory. |
| 127 | + (For example, <filename>NHibernate.Caches.Prevalence.dll</filename> or |
| 128 | + <filename>NHibernate.Caches.SysCache.dll</filename>.) |
117 | 129 | </para>
|
118 | 130 | </listitem>
|
119 | 131 | <listitem>
|
120 | 132 | <para>
|
121 | 133 | To tell NHibernate which cache provider to use, add in your NHibernate configuration file
|
122 | 134 | (can be <filename>YourAssembly.exe.config</filename> or <filename>web.config</filename> or a
|
123 |
| - <filename>.cfg.xml</filename> file, in the latter case the syntax will be different from what |
124 |
| - is shown below): |
| 135 | + <filename>.cfg.xml</filename> file): |
125 | 136 | <programlisting>
|
126 | 137 | <property name="cache.provider_class"><literal>XXX</literal></property><co id="hibernate.cache.provider_class-co" linkends="hibernate.cache.provider_class"/>
|
127 | 138 | <property name="cache.default_expiration"><literal>120</literal></property><co id="nhcaches-expiration-co" linkends="nhcaches-expiration"/>
|
|
312 | 323 | </configSections>]]></programlisting>
|
313 | 324 | </example>
|
314 | 325 |
|
315 |
| - <section> |
| 326 | + <section id="NHibernate.Caches.SysCache2-Table"> |
316 | 327 | <title>Table-based Dependency</title>
|
317 | 328 |
|
318 | 329 | <para>
|
|
369 | 380 | </varlistentry>
|
370 | 381 | </variablelist>
|
371 | 382 |
|
372 |
| - <section> |
| 383 | + <section id="NHibernate.Caches.SysCache2-Command"> |
373 | 384 | <title>Command-Based Dependencies</title>
|
374 | 385 |
|
375 | 386 | <para>
|
|
464 | 475 | </variablelist>
|
465 | 476 | </section>
|
466 | 477 |
|
467 |
| - <section> |
| 478 | + <section id="NHibernate.Caches.SysCache2-Aggregate"> |
468 | 479 | <title>Aggregate Dependencies</title>
|
469 | 480 |
|
470 | 481 | <para>
|
|
508 | 519 | </example>
|
509 | 520 | </section>
|
510 | 521 |
|
511 |
| - <section> |
| 522 | + <section id="NHibernate.Caches.SysCache2-AdditionalSettings"> |
512 | 523 | <title>Additional Settings</title>
|
513 | 524 | <para>
|
514 | 525 | In addition to data dependencies for the cache regions, time based expiration policies can be specified
|
|
571 | 582 | </varlistentry>
|
572 | 583 | </variablelist>
|
573 | 584 | </section>
|
| 585 | + </section> |
574 | 586 |
|
| 587 | + <section id="NHibernate.Caches.EnyimMemcached"> |
| 588 | + <title>EnyimMemcached Configuration</title> |
| 589 | + <para> |
| 590 | + Its configuration relies on the EnyimMemcached library own configuration, through its |
| 591 | + <literal>enyim.com/memcached</literal> configuration section. See |
| 592 | + <ulink url="https://github.com/enyim/EnyimMemcached">project site</ulink>. |
| 593 | + </para> |
575 | 594 | </section>
|
576 | 595 |
|
577 | 596 | <section id="NHibernate.Caches.RtMemoryCache">
|
|
0 commit comments