Announcement Announcement Module
Collapse
No announcement yet.
spring/hibernate/jbosscache Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring/hibernate/jbosscache

    I'd like to learn how to go about configuring jbossCache in spring/hibernate setup.. This is of course not the place to ask but i wondered if anyone had a similar problem. See my post about the problem in hibernate forum if you wish:

    http://forum.hibernate.org/viewtopic.php?t=937510



    In the hibernate ref doc we have:
    14.4.5. Strategy: transactional

    The transactional cache strategy provides support for
    fully transactional cache providers such as JBoss
    TreeCache. Such a cache may only be used in a JTA
    environment and you must specify
    hibernate.transaction.manager_lookup_class.

    But we have the problem described here in a clustered environment:
    http://opensource.atlassian.com/proj...browse/HB-1293

    when we switch to using JTA TxManager. What I understand from the jira issue is that its fixed in jbossCache 1.1.1 (right? )

    I think the issue is about jbosscache tx and hibernate tx synchronization getting out of order when query cache is enabled.

    Should one use JTA and configure jbosscache with a TxManager Lookup class or should it work fine simply by configuring the sessionfactory bean about the cacheprovider being jbosscache? as in below:

    <bean id="myTransactionManager"
    class="org.springframework.orm.hibernate.Hibernate TransactionManager">
    <property name="sessionFactory">
    <ref bean="mySessionFactory"/>
    </property>
    </bean>

    <bean id="myProductServiceTarget"
    class="product.ProductServiceImpl">
    <property name="productDao">
    <ref bean="myProductDao"/>
    </property>
    </bean>

    <bean id="myProductService"
    class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean">
    <property name="transactionManager">
    <ref bean="myTransactionManager"/>
    </property>
    <property name="target">
    <ref bean="myProductServiceTarget"/>
    </property>
    <property name="transactionAttributes">
    <props>
    <prop
    key="increasePrice*">PROPAGATION_REQUIRED</prop>
    <prop
    key="someOtherBusinessMethod">PROPAGATION_MANDATOR Y</prop>
    </props>
    </property>
    </bean>



    Hibernate 2.1.7c
    JbossCache 1.2
    Spring 1.1.3
Working...
X