Announcement Announcement Module
Collapse
No announcement yet.
Wiring Hibernate Transaction Management with Annotations Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Wiring Hibernate Transaction Management with Annotations

    Hi,

    I am trying to wire the HibernateTransactionManager using annotations and for some reason it is not working. I am not sure if it is because of the way I have wired the applicationContext.xml or how I am using the @Transactional annotation.

    The relavent configuration I have in the applicationContext.xml is:
    ----------------------------------------------------------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:jaxrs="http://cxf.apache.org/jaxrs"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...ring-beans.xsd
    http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">

    ....

    <bean id="bankAccountManager" class="com.odc.dataaggregation.manager.BankAccount Manager"/>


    <!-- enable the configuration of transactional behavior based on annotations -->
    <tx:annotation-driven transaction-manager="transactionManager"/>

    <bean id="transactionManager" class="org.springframework.orm.hibernate3.Hibernat eTransactionManager">
    <property name="sessionFactory" ref="sessionFactory" />
    </bean>

    ....

    </beans>
    ----------------------------------------------------------------------

    And I have a method in the BankAccountManager class that has an @Transactional annotation.

    Is there anything I have missed in the configuration or in the understanding of how the TransactionManager works?

    Many thanks,
    Amisha
Working...
X