I do not want any of my db updates to be part of a transaction. Each one should commit as it is performed.
My problem is that this is not happening. Nothing is commited till the end.
I was able to solve this problem by shutting off transaction sychronization however I get an IllegalStateException (I must have sychronization) when the second db update is attempted.
<bean id="ReportEngine" parent="myTransactionManager" >
<property name="target">
<bean class="net.idt.ReportEngine.Report.ReportEngine">
<property name="queryGroupDao">
<ref local="QueryGroupDao"/>
</property>
<property name="reportEngineParamDao">
<ref local="ReportEngineParamDao"/>
</property>
</bean>
</property>
</bean>
<bean id="mySessionFactory"
class="org.springframework.orm.hibernate.LocalSess ionFactoryBean">
<property name="mappingLocations">
<list>
<value>/code/config/QueryGroup.hbm.xml</value>
<value>/code/config/Query.hbm.xml</value>
<value>/code/config/ReportSource.hbm.xml</value>
<value>/code/config/FTPQueryAction.hbm.xml</value>
<value>/code/config/EmailQueryAction.hbm.xml</value>
<value>/code/config/FTPHost.hbm.xml</value>
<value>/code/config/EmailAddress.hbm.xml</value>
<value>/code/config/GroupEmailInfo.hbm.xml</value>
<value>/code/config/ReportEngineParam.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">net.sf.hibernate.dialect.O racle9Dialect</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" />
<bean id="oracleLobHandler" class="org.springframework.jdbc.support.lob.Oracle LobHandler">
<property name="nativeJdbcExtractor">
<ref local="nativeJdbcExtractor"/>
</property>
</bean>
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName">
<value>oracle.jdbc.driver.OracleDriver</value>
</property>
<property name="url">
<value>jdbc:oracle:thin:@ora-il:1521:tomcatdv</value>
<!--<value>jdbc:oracle:thin:@scrooge.corp.idt.net:1521 :csh2go</value>-->
</property>
<property name="username">
<value>tre_app</value>
</property>
<property name="password">
<value>tre_app</value>
</property>
</bean>
<!-- Hibernate Transaction Manager -->
<bean id="transactionManager" class="org.springframework.orm.hibernate.Hibernate TransactionManager">
<property name="sessionFactory">
<ref bean="mySessionFactory"/>
</property>
<property name="transactionSynchronization">
<value>1</value>
</property>
</bean>
<bean id="myTransactionManager" class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean">
<property name="transactionManager"><ref local="transactionManager"/></property>
<property name="target"><ref bean="ReportGenerator"/></property>
<property name="proxyTargetClass"><value>true</value></property>
<property name="transactionAttributes">
<props>
<prop key="*">PROPAGATION_SUPPORTS</prop>
</props>
</property>
</bean>


Reply With Quote