kwan
Dec 1st, 2006, 07:26 AM
I have two similar beans defined, one bean when invoked will call for :
[org.springframework.transaction.interceptor.RuleBa sedTransactionAttribute] - <Applying rules to determine whether transaction should rollback on null>
2006-12-01 12:28:48,857 DEBUG [org.springframework.transaction.interceptor.RuleBa sedTransactionAttribute] - <Winning rollback rule is: RollbackRule with pattern [Exception]>
2006-12-01 12:28:48,857 DEBUG [org.springframework.transaction.interceptor.Transa ctionInterceptor] - <Invoking rollback for transaction on se.lantmateriet.alp.bus.UnderrattelseService.under ratta due to throwable [null]>
2006-12-01 12:28:48,867 DEBUG [org.springframework.orm.hibernate3.HibernateTransa ctionManager] - <Triggering beforeCompletion synchronization>
2006-12-01 12:28:48,867 DEBUG [org.springframework.orm.hibernate3.HibernateTransa ctionManager] - <Initiating transaction rollback>
and thereby rollback (not being able to start the transaction).
The other bean works fine.
Here is the beandef for:
shared parent defination:
<bean id="abstractService" abstract="true" class="org.springframework.transaction.interceptor.Transa ctionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager"/>
</property>
<property name="transactionAttributes">
<props>
<prop key="doCommitThru*">PROPAGATION_REQUIRES_NEW,-Exception</prop>
<prop key="*">PROPAGATION_REQUIRED,-Exception</prop>
</props>
</property>
</bean>
the bean that does not work:
<bean id="underrattelseService" parent="abstractService">
<property name="proxyInterfaces">
<value>se.lantmateriet.alp.bus.UnderrattelseService</value>
</property>
<property name="target">
<bean id="underrattelseTarget" class="se.lantmateriet.alp.bus.UnderrattelseServiceImpl" parent="abstractServiceTarget">
<property name="usDao">
<ref bean="usDaoDelegate"/>
</property>
<property name="utskick">
<ref bean="utskickService"/>
</property>
</bean>
</property>
</bean>
the bean that works:
<bean id="godkannPaminnService" parent="abstractService">
<property name="proxyInterfaces">
<value>se.lantmateriet.alp.bus.GodkannPaminnService</value>
</property>
<property name="target">
<bean id="godkannTarget" class="se.lantmateriet.alp.bus.GodkannPaminnServiceImpl" parent="abstractServiceTarget">
<property name="usDao">
<ref bean="usDaoDelegate"/>
</property>
<property name="utskick">
<ref bean="utskickService"/>
</property>
</bean>
</property>
</bean>
codes to run
ClassPathResource res = new ClassPathResource(
"alp-context-local.xml");
XmlBeanFactory factory = new XmlBeanFactory(res);
UnderrattelseService urs = (UnderrattelseService) factory.
getBean("underrattelseService");
System.exit(urs.underratta());
similar codes to run the other bean. Note that execution will not even enter method underratta().
The two beans used to work well for a long time, then "suddenly" application of rulebased for transaction invokes and causing rollback!
I have been starring at the beandef.xml for many many minutes ... I didn't check the code changes because the problem arises at entry underratta().
I appreciate any clues or response ! Thanks.
/Kwan
[org.springframework.transaction.interceptor.RuleBa sedTransactionAttribute] - <Applying rules to determine whether transaction should rollback on null>
2006-12-01 12:28:48,857 DEBUG [org.springframework.transaction.interceptor.RuleBa sedTransactionAttribute] - <Winning rollback rule is: RollbackRule with pattern [Exception]>
2006-12-01 12:28:48,857 DEBUG [org.springframework.transaction.interceptor.Transa ctionInterceptor] - <Invoking rollback for transaction on se.lantmateriet.alp.bus.UnderrattelseService.under ratta due to throwable [null]>
2006-12-01 12:28:48,867 DEBUG [org.springframework.orm.hibernate3.HibernateTransa ctionManager] - <Triggering beforeCompletion synchronization>
2006-12-01 12:28:48,867 DEBUG [org.springframework.orm.hibernate3.HibernateTransa ctionManager] - <Initiating transaction rollback>
and thereby rollback (not being able to start the transaction).
The other bean works fine.
Here is the beandef for:
shared parent defination:
<bean id="abstractService" abstract="true" class="org.springframework.transaction.interceptor.Transa ctionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager"/>
</property>
<property name="transactionAttributes">
<props>
<prop key="doCommitThru*">PROPAGATION_REQUIRES_NEW,-Exception</prop>
<prop key="*">PROPAGATION_REQUIRED,-Exception</prop>
</props>
</property>
</bean>
the bean that does not work:
<bean id="underrattelseService" parent="abstractService">
<property name="proxyInterfaces">
<value>se.lantmateriet.alp.bus.UnderrattelseService</value>
</property>
<property name="target">
<bean id="underrattelseTarget" class="se.lantmateriet.alp.bus.UnderrattelseServiceImpl" parent="abstractServiceTarget">
<property name="usDao">
<ref bean="usDaoDelegate"/>
</property>
<property name="utskick">
<ref bean="utskickService"/>
</property>
</bean>
</property>
</bean>
the bean that works:
<bean id="godkannPaminnService" parent="abstractService">
<property name="proxyInterfaces">
<value>se.lantmateriet.alp.bus.GodkannPaminnService</value>
</property>
<property name="target">
<bean id="godkannTarget" class="se.lantmateriet.alp.bus.GodkannPaminnServiceImpl" parent="abstractServiceTarget">
<property name="usDao">
<ref bean="usDaoDelegate"/>
</property>
<property name="utskick">
<ref bean="utskickService"/>
</property>
</bean>
</property>
</bean>
codes to run
ClassPathResource res = new ClassPathResource(
"alp-context-local.xml");
XmlBeanFactory factory = new XmlBeanFactory(res);
UnderrattelseService urs = (UnderrattelseService) factory.
getBean("underrattelseService");
System.exit(urs.underratta());
similar codes to run the other bean. Note that execution will not even enter method underratta().
The two beans used to work well for a long time, then "suddenly" application of rulebased for transaction invokes and causing rollback!
I have been starring at the beandef.xml for many many minutes ... I didn't check the code changes because the problem arises at entry underratta().
I appreciate any clues or response ! Thanks.
/Kwan