[jboss-user] [JBoss Cache] - JBossCache 'Malagueta' 3.2.11.GA and persistence.xml

Somostetoi Kilato do-not-reply at jboss.com
Sun Mar 17 11:31:15 EDT 2013


Somostetoi Kilato [https://community.jboss.org/people/somostetoikilato] created the discussion

"JBossCache 'Malagueta' 3.2.11.GA and persistence.xml"

To view the discussion, visit: https://community.jboss.org/message/803140#803140

--------------------------------------------------------------
Hi,

Would anybody help me to configure my persistence-unit to use my cache?

Here is the cache definition file:

<?xml version="1.0" encoding="UTF-8"?>

<deployment xmlns="urn:jboss:bean-deployer:2.0">

    <bean name="MyCacheConfig" class="org.jboss.cache.config.Configuration">
        <property name="runtimeConfig">
            <bean class="org.jboss.cache.config.RuntimeConfig">
                <property name="transactionManager">
                    <inject bean="jboss:service=TransactionManager" property="TransactionManager"/>
                </property>
            </bean>
        </property>
        <property name="lockParentForChildInsertRemove">false</property>
        <property name="lockAcquisitionTimeout">15000</property>
        <property name="isolationLevel">REPEATABLE_READ</property>
        <property name="concurrencyLevel">500</property>
        <property name="useLockStriping">true</property>
        <property name="writeSkewCheck">false</property>
        <property name="exposeManagementStatistics">true</property>
    </bean>

    <bean name="MyCacheFactory" class="org.jboss.cache.DefaultCacheFactory">
        <constructor factoryClass="org.jboss.cache.DefaultCacheFactory" factoryMethod="getInstance" />
    </bean>

    <bean name="MyCache" class="org.jboss.cache.Cache">
        <constructor factoryMethod="createCache">
            <factory bean="MyCacheFactory"/>
            <parameter class="org.jboss.cache.config.Configuration">
                <inject bean="MyCacheConfig"/>
            </parameter>
            <parameter class="boolean">false</parameter>
        </constructor>
    </bean>

    <bean name="MyCacheJmxWrapper" class="org.jboss.cache.jmx.CacheJmxWrapper">
        <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name=jboss.cache:service=MyCache, exposedInterface=org.jboss.cache.jmx.CacheJmxWrapperMBean.class, registerDirectly=true)</annotation>
        <constructor>
            <parameter>
                <inject bean="MyCache"/>
            </parameter>
        </constructor>
    </bean>

</deployment>


and this is the persistence.xml


<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
    xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">

    <persistence-unit name="sarsi_jpa">
        <jta-data-source>java:/SarsiDS</jta-data-source>
        <properties>
            <property name="hibernate.hbm2ddl.auto" value="validate"/>
            <property name="hibernate.show_sql" value="false"/>
            <property name="hibernate.format_sql" value="true"/>
            <property name="hibernate.order_updates" value="true"/>
            
            <property name="hibernate.connection.release_mode" value="after_statement"/>

            <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
            
            <property name="hibernate.cache.use_second_level_cache" value="true" />
            <property name="hibernate.cache.use_query_cache" value="true" />
            <property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.jbc2.MultiplexedJBossCacheRegionFactory" />
             
            <property name="hibernate.session_factory_name" value="persistence.unit.sarsi"/>
            
        </properties>
    </persistence-unit>
</persistence>


If I click on printCacheDetails I get only these

> --- Cache1 ---
> /  null
> 
> ------------
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/803140#803140]

Start a new discussion in JBoss Cache at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2052]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130317/201c6163/attachment-0001.html 


More information about the jboss-user mailing list