Amici ho un terribile problema a lavoro. E' usato spring e hibernate e bisogna scrivere varie cose in due database diversi.
Il problema è che se uno di questi due database solleva un'eccezione ENTRAMBI i database devono effettuare la rollBack.
Mi aiutate a capire come posso fare? Vi posto la configurazione del file xml di uno dei due database che gestisce la transazione![]()
![]()
![]()
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans default-lazy-init="false">
<import resource="classpath*:it/inail/spcoop/convenzioneinps/applicationContext-Service.xml"/>
<bean id="baseTxProxyDB2" abstract="true" class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManagerDB2"/>
</property>
<property name="transactionAttributes">
<props>
<prop key="insert*">
PROPAGATION_REQUIRED, ISOLATION_READ_COMMITTED</prop>
<prop key="update*">
PROPAGATION_REQUIRED, ISOLATION_READ_COMMITTED</prop>
<prop key="delete*">
PROPAGATION_REQUIRED, ISOLATION_READ_COMMITTED</prop>
<prop key="*">
PROPAGATION_SUPPORTS, ISOLATION_READ_COMMITTED, readOnly</prop>
</props>
</property>
<property name="preInterceptors">
<list>
<ref bean="checkServiceUserDetailsParameterInterceptorD B2"/>
</list>
</property>
</bean>
<bean id="checkServiceUserDetailsParameterInterceptorDB2 " class="com.eds.adf.security.CheckServiceUserDetail sParameterInterceptor">
<property name="securityContextRequired" value="false"/>
<property name="securityContextConflictPolicy" value="error"/>
</bean>
<bean id="convenzioneDb2Service" parent="baseTxProxyDB2">
<property name="target" ref="convenzioneDb2ServiceImpl"/>
</bean>
<!--Please extend this object below this comment to better manage conflicts
on new MDD transformation.-->
</beans>

Rispondi quotando