O que estou fazendo de errado na configuração do spring que ele não está dando rollback nas transações?
Vou postar o app.xml com as partes do spring que configuro tudo relacionado a transação.
[code]
<tx:annotation-driven transaction-manager=“transactionManager” />
PROPAGATION_REQUIRED
PROPAGATION_REQUIRED
PROPAGATION_REQUIRED
<bean id="taxonomiaService" parent="txProxyTemplate">
<property name="target">
<bean
class="br.ucsal.projeto.domain.services.impl.TaxonomiaServiceImpl">
<property name="taxonomiaDAO">
<ref bean="taxonomiaDAO" />
</property>
<property name="conceitoDAO">
<ref bean="conceitoDAO" />
</property>
</bean>
</property>
</bean>
<bean id="conceitoService" parent="txProxyTemplate">
<property name="target">
<bean
class="br.ucsal.projeto.domain.services.impl.ConceitoServiceImpl">
<property name="conceitoDAO">
<ref bean="conceitoDAO" />
</property>
</bean>
</property>
</bean>
<bean id="txAttributeSource"
class="org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource">
<property name="properties">
<props>
<prop key="add*">PROPAGATION_REQUIRED</prop>
<prop key="save*">PROPAGATION_REQUIRED</prop>
<prop key="update*">PROPAGATION_REQUIRED</prop>
<prop key="remove*">PROPAGATION_REQUIRED</prop>
<prop key="send*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
<bean id="txInterceptor"
class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager">
<ref local="transactionManager" />
</property>
<property name="transactionAttributeSource">
<ref local="txAttributeSource" />
</property>
</bean>
<bean id="autoProxyCreator"
class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="interceptorNames">
<list>
<idref local="txInterceptor" />
</list>
</property>
<property name="beanNames">
<list>
<value>*Dao</value>
<value>*DAO</value>
</list>
</property>
</bean>
<bean id="taxonomiaDAO"
class="br.ucsal.projeto.domain.dao.impl.TaxonomiaDAOImpl"
parent="daoTemplate" />[/code]
Minha classe de serviço:
[code]@Transactional(propagation=Propagation.REQUIRED)
public class TaxonomiaServiceImpl implements TaxonomiaService {
//omitido outras coisas inclusive atributos…
public void save(TaxonomiaModel taxonomiaModel,List conceitos) {
Long id = (Long) taxonomiaDAO.save(taxonomiaModel);
taxonomiaModel = taxonomiaDAO.load(id);
for(ConceitoModel conceitoModel: conceitos){
conceitoModel.setTaxonomiaModel(taxonomiaModel);
conceitoDAO.save(conceitoModel);
}
}[/code]
Ele salva uma taxonomia e quando tenho erro no método save de conceitoDAO, ele não da rollback na taxonomia persistida anteriormente.