wood burning stoves 2.0*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes HFE - Page 371!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "HFE - Page 371!!!" Watch "HFE - Page 371!!!" New topic
Author

HFE - Page 371!!!

Brian Smith
Ranch Hand

Joined: Oct 26, 2002
Posts: 232
hi folks,
what is the meaning and signficance of question 18? Why are those methods must run in the transaction context of the methods that invoke those methods?
namaste
Keith Rosenfield
Ranch Hand

Joined: Nov 25, 2003
Posts: 277
Hi Namaste:
The following quotes are found in 10.5.3 of the spec.
The container must invoke this method in the transaction context determined by the transaction
attribute of the business method that triggered the ejbLoad method.

A select method executes in the transaction context determined by the transaction attribute of
the invoking business method.

The container must ensure that the ejbRemove method and database delete operations are
performed in the transaction context determined by the transaction attribute of the invoked
remove method

It is clear from these quotes that ejbLoad, ejbSelect and ejbRemove run in the transaction context of the method that causes their invocation. ejbLoad and ejbSelect are invoked from business methods and ejbRemove is invoked from a remove method.
As for why it is necessary for them to run in the same context, I'm not sure. Can anyone clear this up.
[ December 13, 2003: Message edited by: Keith Rosenfield ]

Keith Rosenfield<br />SCJP<br />SCWCD<br />SCBCD
Mikalai Zaikin
Ranch Hand

Joined: Jun 04, 2002
Posts: 3199
    
    5
Hi,
Let's think of entity bean as a row in the table,
So, any opeation with data in DB table has to be performed within transaction, otherwise we could loose data consistency.
Cheers


Free SCDJWS 5.0 Study Guide - SCDJWS 5.0 Quiz (How to get SCDJWS 5.0 Quiz)
Java Platform, Enterprise Edition 6 Web Services Developer Certified Expert Exam Study Guide and Quiz
Nauman Khan
Ranch Hand

Joined: Aug 07, 2003
Posts: 49
Hi Mikali,
This is right but why is the condition that these ejbLoad,ejbStore,ejbRemove etc method run in the context of calling method transaction, why it cannot run in its own transaction context?.
Regards,


Nauman Khan <br />SCJP,MCSE,SCWCD,SCBCD,SCWCD1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HFE - Page 371!!!
 
Similar Threads
Adding a day to a java.util.date
what is syncronized with "syncronize" keyword
is it add methods in the data.class will lost points?
How to determine weather a file is in use?
I can't see ejbCreat(),ejbRemove or initialize() methods in this MDB.