Max object graph size in XML Conf

776 views
Skip to first unread message

Kriss Cardenas

unread,
Dec 19, 2017, 4:38:15 PM12/19/17
to ehcache-users
Hi,

I am using Ecache 3.X and using the JSR API. I want to improve the max-object-graph-size because I have some big objects and I can't find how to write it down in my XML Configuration.

I tried :
max-object-graph-size
and
<sizeOfPolicy maxDepth="10000" maxDepthExceededBehavior="abort"/>

I think maybe JSR doesn't support this, do you have any workaround  other than the @IgnoreSizeOf  tag?

Here's is the last configuration that I tried :

<?xml version='1.0' encoding='utf-8'?>
<config xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns='http://www.ehcache.org/v3' xmlns:jsr107='http://www.ehcache.org/v3/jsr107'
    xsi:schemaLocation="
        http://www.ehcache.org/v3 http://www.ehcache.org/schema/ehcache-core-3.0.xsd
        http://www.ehcache.org/v3/jsr107 http://www.ehcache.org/schema/ehcache-107-ext-3.0.xsd">

    <service>
        <jsr107:defaults default-template="proxyCache" enable-management="false" enable-statistics="false" />
    </service>

    <!-- By reference small cache -->
    <cache-template name="proxyCache">
        <key-type copier="org.ehcache.impl.copy.IdentityCopier">java.lang.String</key-type>
        <value-type copier="org.ehcache.impl.copy.IdentityCopier">com.xxx.xxx.xxx.cADO</value-type>
        <expiry>
            <tti unit="seconds">60</tti>
        </expiry>
        <heap unit="MB">50</heap>
        <max-object-graph-size>10000</max-object-graph-size>
    </cache-template>


    <cache alias="serverCache">
        <key-type>java.lang.String</key-type>
        <value-type>com.xxx.xxx.xxx.cADO</value-type>
        <expiry>
            <tti unit="minutes">5</tti>
        </expiry>
        <heap unit="MB">500</heap>
        <max-object-graph-size>10000</max-object-graph-size>
        <jsr107:mbeans enable-management="false" enable-statistics="false" />
    </cache>
</config>

Louis Jacomet

unread,
Dec 20, 2017, 5:49:19 AM12/20/17
to ehcach...@googlegroups.com
Hi,

It is supported in the XML configuration, you are just placing the content at the wrong place in the XML.

Have a look at the sample in the code repository:
I have filed an issue so that the documentation contains an XML sample - see https://github.com/ehcache/ehcache3/issues/2218.

Regards,
Louis

--
You received this message because you are subscribed to the Google Groups "ehcache-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ehcache-user...@googlegroups.com.
To post to this group, send email to ehcach...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ehcache-users/eb6979f8-bd89-40e9-88e9-b97d02c1a9f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kriss Cardenas

unread,
Dec 20, 2017, 11:26:01 AM12/20/17
to ehcache-users
Hi Louis,

That worked for me, thank you very much!

-Kriss-
Reply all
Reply to author
Forward
0 new messages