2
~ Hibernate, Relational Persistence for Idiomatic Java
4
~ Copyright (c) 2007, Red Hat Middleware LLC or third-party contributors as
5
~ indicated by the @author tags or express copyright attribution
6
~ statements applied by the authors. All third-party contributions are
7
~ distributed under license by Red Hat Middleware LLC.
9
~ This copyrighted material is made available to anyone wishing to use, modify,
10
~ copy, or redistribute it subject to the terms and conditions of the GNU
11
~ Lesser General Public License, as published by the Free Software Foundation.
13
~ This program is distributed in the hope that it will be useful,
14
~ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15
~ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
18
~ You should have received a copy of the GNU Lesser General Public License
19
~ along with this distribution; if not, write to:
20
~ Free Software Foundation, Inc.
21
~ 51 Franklin Street, Fifth Floor
22
~ Boston, MA 02110-1301 USA
26
<!-- Sets the path to the directory where cache .data files are created.
28
If the path is a Java System Property it is replaced by
29
its value in the running VM.
31
The following properties are translated:
32
user.home - User's home directory
33
user.dir - User's current working directory
34
java.io.tmpdir - Default temp file path -->
35
<diskStore path="java.io.tmpdir"/>
38
<!--Default Cache configuration. These will applied to caches programmatically created through
41
The following attributes are required for defaultCache:
43
maxInMemory - Sets the maximum number of objects that will be created in memory
44
eternal - Sets whether elements are eternal. If eternal, timeouts are ignored and the element
46
timeToIdleSeconds - Sets the time to idle for an element before it expires. Is only used
47
if the element is not eternal. Idle time is now - last accessed time
48
timeToLiveSeconds - Sets the time to live for an element before it expires. Is only used
49
if the element is not eternal. TTL is now - creation time
50
overflowToDisk - Sets whether elements can overflow to disk when the in-memory cache
51
has reached the maxInMemory limit.
55
maxElementsInMemory="10000"
57
timeToIdleSeconds="120"
58
timeToLiveSeconds="120"
62
<!--Predefined caches. Add your cache configuration settings here.
63
If you do not have a configuration for your cache a WARNING will be issued when the
66
The following attributes are required for defaultCache:
68
name - Sets the name of the cache. This is used to identify the cache. It must be unique.
69
maxInMemory - Sets the maximum number of objects that will be created in memory
70
eternal - Sets whether elements are eternal. If eternal, timeouts are ignored and the element
72
timeToIdleSeconds - Sets the time to idle for an element before it expires. Is only used
73
if the element is not eternal. Idle time is now - last accessed time
74
timeToLiveSeconds - Sets the time to live for an element before it expires. Is only used
75
if the element is not eternal. TTL is now - creation time
76
overflowToDisk - Sets whether elements can overflow to disk when the in-memory cache
77
has reached the maxInMemory limit.
81
<!-- Sample cache named sampleCache1
82
This cache contains a maximum in memory of 10000 elements, and will expire
83
an element if it is idle for more than 5 minutes and lives for more than
86
If there are more than 10000 elements it will overflow to the
87
disk cache, which in this configuration will go to wherever java.io.tmp is
88
defined on your system. On a standard Linux system this will be /tmp"
90
<cache name="sampleCache1"
91
maxElementsInMemory="10000"
93
timeToIdleSeconds="300"
94
timeToLiveSeconds="600"
98
<!-- Sample cache named sampleCache2
99
This cache contains 1000 elements. Elements will always be held in memory.
100
They are not expired. -->
101
<cache name="sampleCache2"
102
maxElementsInMemory="1000"
104
timeToIdleSeconds="0"
105
timeToLiveSeconds="0"
106
overflowToDisk="false"
109
<!-- Place configuration for your caches following -->