• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ejbRemove and transaction context

 
Walker Rustin
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
 
Vishwa Kumba
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic