• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Transaction Attribute & Rollback Question

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

If I have a session bean (A) calling 3 other methods in 3 other diffent session beans (B,C,D)
as follows with the transaction attributes:


A ---> B (Create, Transaction Attribute: Required)
---> C (Query, Transaction Attribute: Never)
---> D (Delete, Transaction Attribute: Required)

Question: If there's a failure in Sesssion Bean D, will the whole transaction be roll backed to B? Assuming that the context.setRollBackOnly method is being called in each of the catch method.
Thanks.
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I assume there is no transaction in A, otherwise A'll get an RemoteException calling C.

A calls B. B starts a transaction, say Tx-B, and completes (commit).
A calls C.
A calls D. D starts a transaction, say Tx-D, and rollbacks. This will cause only Tx-D to rollback, not Tx-B.

J2EE does not support nested transactions. If you want Tx-B to rollback as well, then you need to use "Required" in A and change "Never" to "NotSupported" in C.

No warranty on what you just read
 
look! it's a bird! it's a plane! It's .... a teeny tiny ad
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic