I am using spring 1.1.2 , hibernate 2.1. and oracle 9i. I am using clobs.
When trying to access records in the db I get the following error:
Active Spring transaction synchronization or jtaTransactionManager on LocalSessionFactoryBean plus active JTA transaction required
I looked through the forum and saw that I need to make Spring aware of my hibernate transactions.
I configured it exactly how the forums indicated and yet I am still getting the error. What am I doing wrong? The following is my configuration.
Code:<bean id="mySessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean"> <property name="mappingLocations"> <list> <value>/WEB-INF/QueryGroup.hbm.xml</value> <value>/WEB-INF/Query.hbm.xml</value> <value>/WEB-INF/ReportSource.hbm.xml</value> <value>/WEB-INF/FTPQueryAction.hbm.xml</value> <value>/WEB-INF/EmailQueryAction.hbm.xml</value> <value>/WEB-INF/FTPHost.hbm.xml</value> <value>/WEB-INF/EmailAddress.hbm.xml</value> <value>/WEB-INF/GroupEmailInfo.hbm.xml</value> </list> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">net.sf.hibernate.dialect.Oracle9Dialect</prop> </props> </property> <property name="dataSource"> <ref bean="dataSource"/> </property> <property name="lobHandler"> <ref local="oracleLobHandler"/> </property> </bean> <!-- Database LOB Handling --> <bean id="nativeJdbcExtractor" class="org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor" lazy-init="true"/> <bean id="oracleLobHandler" class="org.springframework.jdbc.support.lob.OracleLobHandler"> <property name="nativeJdbcExtractor"> <ref local="nativeJdbcExtractor"/> </property> </bean> <!-- Hibernate Transaction Manager --> <bean id="transactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager"> <property name="sessionFactory"> <ref bean="mySessionFactory"/> </property> </bean> <bean id="myTransactionManager" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager"><ref local="transactionManager"/></property> <property name="target"><ref bean="/Retriever"/></property> <property name="proxyTargetClass"><value>true</value></property> <property name="transactionAttributes"> <props> <prop key="Save*">PROPAGATION_REQUIRED</prop> <prop key="save*">PROPAGATION_REQUIRED</prop> <prop key="get*">PROPAGATION_REQUIRED</prop> <prop key="list*">PROPAGATION_REQUIRED</prop> </props> </property> </bean> <bean name="/Retriever" class="net.idt.ReportEngine.Editor.GroupEditor"> <property name="queryGroupDao"><ref bean="QueryGroupDao"/></property> </bean> <bean id="QueryGroupDao" class="net.idt.ReportEngine.dao.QueryGroupDao"> <property name="sessionFactory"> <ref bean="mySessionFactory"/> </property> </bean>


Reply With Quote
) is that you define your transactionManager, then define your bean, and then define a transactionAware proxy whose name is the bean you are wrapping, i.e.: