<commit_before><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<!--
    Copyright 2010 The myBatis Team

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<!--
    version: $Id$
-->
<book>

    <bookinfo>
        <title>MyBatis EHCache integration - Reference Documentation</title>

        <authorgroup>
            <author>
                <firstname>Simone</firstname>
                <surname>Tripodi</surname>
                <affiliation>
                    <orgname>MyBatis.org</orgname>
                </affiliation>
            </author>
        </authorgroup>

        <legalnotice>
            <para>Copies of this document may be made for your own use
                and for
                distribution to others, provided that you do not charge any fee for such
                copies and further provided that each copy contains this Copyright
                Notice, whether distributed in print or electronically.
            </para>
        </legalnotice>
    </bookinfo>

    <chapter>
        <title>The MyBatis EHCache integration</title>
        <section>
            <title>How to</title>
            <para><ulink url="http://ehcache.org/">EHCache</ulink> is a widely used java distributed cache for general purpose caching,
            Java EE and light-weight containers.</para>
            <para>The EHCache integration is built on top of the <literal>ehcache-core</literal> and comes without
            any EHCache 3rd part applications. Please refeer to official EHCache
            <ulink url="http://ehcache.org/documentation/index.html">documentation</ulink> if you need plugins.</para>
            <para>Users that want to use EHCache into their applications, first have to add in
            the <literal>pom.xml</literal> the following dependency:</para>
            <programlisting language="xml"><![CDATA[<dependencies>
    ...
    <dependency>
        <groupId>]]><?eval ${project.groupId}?><![CDATA[</groupId>
        <artifactId>]]><?eval ${project.artifactId}?><![CDATA[</artifactId>
        <version>]]><?eval ${project.version}?><![CDATA[</version>
    </dependency>
    ...
</dependencies>]]></programlisting>
            <para>then, just configure it in the mapper XML</para>
            <programlisting language="xml"><![CDATA[<mapper namespace="org.acme.FooMapper">

    <cache type="org.mybatis.caches.ehcache.EhcacheCache"/>

    ...

</mapper>]]></programlisting>
            <para>Users that need to configure EHCache through XML configuration file, have to
  put in the classpath the <literal>/ehcache.xml</literal> resource; please refeer to the
  official EHCache <ulink url="http://ehcache.org/documentation/configuration.html">documentation</ulink>
  to know more details.</para>

            <para>If the <literal>/ehcache.xml</literal> resource is not found or something goes
  wrong while loading it, the default configuration will be used.</para>
        </section>
    </chapter><commit_msg>added in the reference manuals the Logging caches<commit_after><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<!--
    Copyright 2010 The myBatis Team

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<!--
    version: $Id$
-->
<book>

    <bookinfo>
        <title>MyBatis EHCache integration - Reference Documentation</title>

        <authorgroup>
            <author>
                <firstname>Simone</firstname>
                <surname>Tripodi</surname>
                <affiliation>
                    <orgname>MyBatis.org</orgname>
                </affiliation>
            </author>
        </authorgroup>

        <legalnotice>
            <para>Copies of this document may be made for your own use
                and for
                distribution to others, provided that you do not charge any fee for such
                copies and further provided that each copy contains this Copyright
                Notice, whether distributed in print or electronically.
            </para>
        </legalnotice>
    </bookinfo>

    <chapter>
        <title>The MyBatis EHCache integration</title>
        <section>
            <title>How to</title>
            <para><ulink url="http://ehcache.org/">EHCache</ulink> is a widely used java distributed cache for general purpose caching,
            Java EE and light-weight containers.</para>
            <para>The EHCache integration is built on top of the <literal>ehcache-core</literal> and comes without
            any EHCache 3rd part applications. Please refeer to official EHCache
            <ulink url="http://ehcache.org/documentation/index.html">documentation</ulink> if you need plugins.</para>
            <para>Users that want to use EHCache into their applications, first have to add in
            the <literal>pom.xml</literal> the following dependency:</para>
            <programlisting language="xml"><![CDATA[<dependencies>
    ...
    <dependency>
        <groupId>]]><?eval ${project.groupId}?><![CDATA[</groupId>
        <artifactId>]]><?eval ${project.artifactId}?><![CDATA[</artifactId>
        <version>]]><?eval ${project.version}?><![CDATA[</version>
    </dependency>
    ...
</dependencies>]]></programlisting>
            <para>then, just configure it in the mapper XML</para>
            <programlisting language="xml"><![CDATA[<mapper namespace="org.acme.FooMapper">

    <cache type="]]><?eval ${project.groupId}?><![CDATA[.ehcache.EhcacheCache"/>

    ...

</mapper>]]></programlisting>
            <para>If users need to log cache operations, they can plug the Cache logging version:</para>
            <programlisting language="xml"><![CDATA[<mapper namespace="org.acme.FooMapper">

    <cache type="]]><?eval ${project.groupId}?><![CDATA[.ehcache.LoggingEhcache"/>

    ...

</mapper>]]></programlisting>
            <para>Users that need to configure EHCache through XML configuration file, have to
  put in the classpath the <literal>/ehcache.xml</literal> resource; please refeer to the
  official EHCache <ulink url="http://ehcache.org/documentation/configuration.html">documentation</ulink>
  to know more details.</para>

            <para>If the <literal>/ehcache.xml</literal> resource is not found or something goes
  wrong while loading it, the default configuration will be used.</para>
        </section>
    </chapter>
{'fraction_non_alphanumeric': 0.11587470135386249, 'fraction_numerical': 0.004247411733474914, 'mean_word_length': 2.655992236778263, 'pattern_counts': {'":': 0, '<': 183, '<?xml version=': 2, '>': 183, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 15}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3997172', 'n_tokens_mistral': 2101, 'n_tokens_neox': 1962, 'n_words': 650}