• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Can't understand the answer

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I'm prepearing to take 310-090 exam next week and have unresolved questions. I read ejb 2.0 spec and still can�t find answer on my question. Any answers will be so much appreciated.
Here it is:

Which three, of a session bean that implements SessionSynchronization, are called with an
unspecified transaction context? (Choose three.)

A. constructor
B. afterBegin
C. afterCompletion
D. beforeCompletion
E. setSessionContext

Answer: A, C, E


That means that if the session bean was called with unspecified context (but not without it) then I won�t be able to rollback the transaction in beforeCompletion method. I tried to find any references in ejb spec about circumstances when do SessionSynchronization callback methods won�t be called but I couldn�t find anything.
Can anyone explain it for me why does B and D are not correct.
 
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

SessionSynchronization can only be implemented by a stateful session bean with bean managed transaction demarcation. It is not possible that session bean is called with an unspecified transaction context because your bean's (which implements SessionSynchronization) methods should use the transaction's attribute as REQUIRED, REQUIRES_NEW or MANDATORY otherwise container will raise error.

Hope it clarifies
 
If you live in a cold climate and on the grid, incandescent light can use less energy than LED. Tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic