Announcement Announcement Module
No announcement yet.
propagation_required in TransactionProxyFactoryBean Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • propagation_required in TransactionProxyFactoryBean


    Could someone explain to me what exactly is the meaning of PROPAGATION_REQUIRED in a typical TransactionProxyFactoryBean configuration, e.g.

    <bean id="proxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
      <property name="transactionManager"><ref local="transactionManager"/></property>
      <property name="target">
        <bean class="">
            <property name="sessionFactory"><ref local="sessionFactory"/></property>
      <property name="transactionAttributes">
          <prop key="*">PROPAGATION_REQUIRED</prop>	
    I looked in the reference manual, but it doesn't say much about it...
    I thought it means that if you call one proxied method within another, as in updateFoo()

    class MyDAOImpl() {
      public void updateFoo() {
      public void updateBar() {
    then the transaction started by updateFoo() will be propagated to updateBar().

    However, in a separate thread I was told that in a scenario such as the above, updateBar() will not be intercepted when it is called within updateFoo(). So if only one of the method calls is intercepted, then there is no possibility that 2 transactions could ever be started, which doesn't tally with my previous understanding of PROPOGATION_REQUIRED

    Thanks in advance,

  • #2
    That means that if you try to run new transaction withing existing one (for example, by calling to another service from transactional method of you first service) second transaction will partisipate in your first transaction and will reuse all resources of that one (i.e. db connection, etc.).