Olá, naquele tutorial do hibernate avancado que mauricio fez, tem o codigo abaixo.
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref local="sessionFactory"/>
</property>
<property name="dataSource">
<ref local="dataSource"/>
</property>
</bean>
<bean id="daoGenericoTransacional"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref local="transactionManager"/>
</property>
<property name="target">
<ref local="daoAlvo"/>
</property>
<property name="transactionAttributes">
<props>
<prop key="delete*">
PROPAGATION_REQUIRED, ISOLATION_READ_COMMITTED
</prop>
<prop key="save*">
PROPAGATION_REQUIRED, ISOLATION_READ_COMMITTED
</prop>
<prop key="update*">
PROPAGATION_REQUIRED, ISOLATION_READ_COMMITTED
</prop>
<prop key="get*">
PROPAGATION_SUPPORTS, readOnly
</prop>
<prop key="list*">
PROPAGATION_SUPPORTS, readOnly
</prop>
</props>
</property>
</bean>
</beans>
porém como o spring vai saber quando commitar, pois eu posso querer em um metodo cadastrarMaterial, usar um select, para carregar um objeto, depois inserir o material e por final atualizar outro objeto lá. Ou diferente disso eu posso querer que o update e o insert sejam realizadas em transações diferentes.
eu ainda não conseguir entender como ele faz isso, e se ele realmente faz.
alguem poderia me explicar?