Results 1 to 2 of 2

Thread: Nested transactions

  1. #1
    Join Date
    Aug 2004
    Posts
    10

    Default Nested transactions

    I´m not too sure whether I understand the concept of PROPAGATION_REQUIRED

    Classic definition says “execute within a current transaction, create a new transaction if none exists"

    Imagine I define businessMethodA() in class A and businessMethodB() in class B both as PROPAGATION_REQUIRED

    Some day a developer makes a call from A.businessMethodA() to B.businessMethodB(), should I guess after B method completes a commit would be issued? Or better, does Spring recognize the sorrounding transaction of businessMethodA() and stops the commit until this method finishes?

    Let's consider the following sequence:

    1) A.businessMethodA() starts
    2) A calls B so B.businessMethodB() starts
    3) B.businessMethodB() ends
    4) A.businessMethodA() fails

    A rollback is issued but until which demarcation? Start of 4) or start of 1)?
    Diego Dagum
    Self-confidence, Chile

  2. #2
    Join Date
    Aug 2004
    Posts
    1,104

    Default

    A.businessMethodA() and B.businessMethodB() will both run within the same transaction and in your scenario the rollback will affect everything done since A.businessMethodA() started.

    The commit would be issued when A.businessMethodA() completes without causing a rollback.
    Thomas Risberg
    SpringSource by Pivotal
    http://www.springsource.org

Similar Threads

  1. Replies: 5
    Last Post: Mar 8th, 2006, 04:32 AM
  2. Context initialization failed
    By kanonmicke in forum Container
    Replies: 7
    Last Post: Sep 29th, 2005, 12:35 AM
  3. Replies: 0
    Last Post: Jul 11th, 2005, 05:49 PM
  4. Replies: 3
    Last Post: Nov 8th, 2004, 07:30 PM
  5. Replies: 23
    Last Post: Aug 23rd, 2004, 09:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •