Announcement Announcement Module
Collapse
No announcement yet.
Declarative transaction management in Spring Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    If i do two "createProducto", and cause and exception on the second, the rollback only affect to the last one.
    That's exactly what should happen as every createProducto call is a transaction for itself, unless you have another transaction that encloses both calls.

    You can create a proxy like you did for your dao:

    Code:
    <bean id="blankProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
          <property name="transactionManager"><ref local="txManager"/></property>
          <property name="target"><ref local="blankTarget"/></property>
          <property name="transactionAttributes">
             <props>
                <prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
             </props>
          </property>
       </bean>

    for the class and the method that invokes createProduto twice and it should work.

    Comment

    Working...
    X