Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

ejbRemove and transaction context

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HFEJB - q 18 page 371
The answer says that ejbRemove runs in the transaction context of the method that causes their invocations.
I read in the spec that a transaction type must be mentioned for ejbRemove(). If I am mentioning a transaction of 'RequiredNew' then how come ejbRemove would run under the tx of the invoker.
thanks.
- walk rustin
 
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ejbSelect() and ejbLoad() methods run in the transaction context of the called business method exposed in the remote interface.
ejbRemove() runs in the transaction context of the corresponding remove() method, present in the home/remote interface. (the transaction context attribute needs to be specified for both the remove methods in the home interface remove(handle),remove(primarykey) and also remove() method of the remote interface in the DD).
The question could have been properly phrased as :

Which method(s) run in the transaction context of the business method that causes their invocation?....

(the word business is missing in the actual question in the book)
then there are only 2 answers, ejbSelect() and ejbLoad(), else 3 answers including ejbRemove.
ejbActivate(), ejbPassivate() and setEntityContext() anyway run in an unspecified transaction context.
[ March 19, 2004: Message edited by: Vish Kumar ]
 
There are 29 Knuts in one Sickle, and 17 Sickles make up a Galleon. 42 tiny ads in a knut:
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
    Bookmark Topic Watch Topic
  • New Topic