Win a copy of OCP Oracle Certified Professional Java SE 11 Developer Practice Tests this week in the OCP forum!
  • 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Tim Cooke
Sheriffs:
  • Devaka Cooray
  • paul wheaton
  • Mark Herschberg
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
  • Jj Roberts
Bartenders:
  • Carey Brown
  • salvin francis
  • Piet Souris

Transaction Demarcation

 
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Looks weird, but is it valid?

Also, what are the tranaction attributes allowed on timeout methods? and why?
 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Niranjan,

Yes, it is valid. This is one of the things that you can only do with BMT, start a transaction in one method of a stateful session bean and commit in another method. This is discussed a little bit in EJB3 in action, page 201, section 6.3.4

As for timeout method, Required or Requires_New are allowed (refer to the sidebar EJB Timers and Transactions, page 173 of the same book). I am not sure why only these two are allowed, I am suspecting because the container is invoking the timeout method not a client.
 
Ranch Hand
Posts: 757
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Promod Mahajan wrote:As for timeout method, Required or Requires_New are allowed.



As I heard, NOT_SUPPORTED is also available, in addition to above two types.
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Pramod,

Thanks for pointing the relevant pages. The page 201 also says

Another drawback for BMT is the fact that it can never join an existing transaction. Existing transactions are always suspended when calling a BMT method, significantly limiting flexible component reuse.



To avoid this we use joinTransaction( ). Correct?

@Clark,
Yes I have read in Java Beat that NOT_SUPPORTED is also one of the supported types for Time out methods.
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

To avoid this we use joinTransaction( ). Correct?



No. joinTransaction() is a method of EntityManager. It allows the EntityManager created outside the transcation can join the current transaction. It has nothing to do with the discussion of BMT here.
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oops! I mixed up thigs terribly!
 
sunglasses are a type of coolness prosthetic. Check out the sunglasses on this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic