Results 1 to 3 of 3

Thread: Transaction within transaction

  1. #1
    Join Date
    Jun 2008
    Posts
    10

    Default Transaction within transaction

    Hi,

    Is it possible to have a transaction (handled by the PlatformTransactionmanager) within a CMT?

    Ie mdb started, calls method in pojo, starts new tx,does stuff, commits that transaction, returns and finishes other things in CMT?

    The transactions must be independant, ie tx 1 will start, tx2 will start, tx2 can commit or rollback without affecting tx1. tx1 will then commit.

    Regards,
    Andrew

  2. #2
    Join Date
    May 2007
    Location
    Istanbul
    Posts
    42

    Default

    you can do it using REQUIRES_NEW transaction propagation.
    Senior Consultant
    Turkiye Is Bankasi

  3. #3
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    668

    Lightbulb Mixing transaction management styles

    I think Andy knows about the "requires new" transaction semantics; I think he's asking whether it's OK to mix transaction declaration styles, i.e. have some of your transactional behaviour defined using classic CMT and the rest defined using Spring's PlatformTransactionManager API (as per the reference guide, e.g. via @Transactional annotations and so on).

    I certainly hope this approach is OK, because I'm using it on a live app!
    Andrew Swan
    "Now is the EJB of our discontent made glorious Spring"

Posting Permissions

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