Hi,
I am using declarative transaction management on methods starting with save, delete, etc. Code snippet is as follows:
<bean id="txTemplate" abstract="true" class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean">
<property name="transactionManager" ref="txManager" />
<property name="transactionAttributes">
<props>
<prop key="save*">PROPAGATION_REQUIRED</prop>
<prop key="delete*">PROPAGATION_REQUIRED</prop>
....
<bean id="appFacade" parent="txTemplate">
<property name="target">
<bean id="appFacadeImpl" class="test.facade.AppFacadeImpl" />
</property>
</bean>
As per the above code, transaction will be invoked for methods starting with save and delete in AppFacadeImpl.
Suppose, in AppFacadeImpl I have a dummy method create* which calls the save* method inside it. save* method executes few database operations.
If I try to invoke the create* method of AppFacadeImpl instead of save* method, I am getting an exception 'Session is closed' when i try to fetch a data from the database. Will declarative transaction won't start a transaction for sub methods?


Reply With Quote
