Announcement Announcement Module
Collapse
No announcement yet.
Starting a new Transaction Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Starting a new Transaction

    I've got my transaction interceptor configured as follows. My transactions are starting successfully and committing, but what I want to do is define on a particular Dao and method for a new Transaction to start, suspending the existing transaction. How do I define this?

    Thanks....

    Code:
    <!--TRANSACTION INTERCEPTOR-->	
    <bean id="matchAllTxInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
          <property name="transactionManager">
    		  <ref bean="transactionManager"/>
    		</property>
    		<property name="transactionAttributes">
    			<props>
    				<prop key="insert*">PROPAGATION_REQUIRED</prop>
    				<prop key="update*">PROPAGATION_REQUIRED</prop>
    				<prop key="delete*">PROPAGATION_REQUIRED</prop>
    				<prop key="getNext*">PROPAGATION_REQUIRED</prop>
    				<prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
    			</props>
    		</property>		
        </bean>
        
    <bean id="autoProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
          <property name="interceptorNames">
            <list>
              <idref local="matchAllTxInterceptor"/>
            </list>
          </property>
          <property name="beanNames">
            <list>
              <value>*Dao</value>
            </list>
          </property>
        </bean>

  • #2
    Add your exact method name in your transactionAttribute and use the PROPAGATION_REQUIRES_NEW value.

    Comment


    • #3
      Thanks very much! It worked like a charm.

      Comment

      Working...
      X