wood burning stoves 2.0*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Coffe Cream on EB: mistakes/doubts #1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Coffe Cream on EB: mistakes/doubts #1" Watch "Coffe Cream on EB: mistakes/doubts #1" New topic
Author

Coffe Cream on EB: mistakes/doubts #1

alzamabar
Ranch Hand

Joined: Jul 24, 2002
Posts: 379
Given the following question:

What's true for a bean provider when creating an entity bean using container-managed persistence?

A. Container-manager persistent fields must be defined in the entity bean class.

B. Container-managed relationship fields must be defined in the entity bean class

C. When implementing a one-to-many relationship, the java.util.List interface must not be used

D. Accessor methods for container-managed relationship fields must be exposed in the bean's remote component interface

First of all, this was the Coffe Cream exam of chapter 6 of HF, and relationshiops weren't explained, so how could someone answer correctly regarding B and D?

Secondly, as per specs, chapter 14.1.1:

The EJB 1.1 entity Bean Provider is responsible for using the cmp-field elements of the deployment
descriptor to declare the instance�s fields that the Container must load and store at the defined
times. The fields must be defined in the entity bean class as public, and must not be defined as
transient.
The container is responsible for transferring data between the entity bean�s instance variables and the


For this reason, to me answer A would be correct (although someone could say, it should say that the correct answer was: in the entity bean class AND in the DD (ok, if this is the case, but can the authors or someone like Valentine help me on this...And other doubts on this chapter...As I've done 5 mistakes on 18 questions, and this is not good)

Because I've already read the CMR chapter, it's also true that CMR fields should be declared in the entity bean class (but, if for the same reason as above: read...'Also in the DD' this was an error, it's ok to me), to me answer B could also be true.

Answer C is correct (but how could anyone know before reading the relationships chapter???)

For the same reason as C, how could anyone know that D was incorrect, as CMR should be exposed only in local interfaces?

Please help!!


Marco Tedone<br />SCJP1.4,SCJP5,SCBCD,SCWCD
Dan T
Ranch Hand

Joined: Jun 15, 2004
Posts: 66
for D, I beleive that we must have a local component interface for CMR. Because beans communicate to beans, there must be a local component interface for one bean to access the methods of other bean (or else how would one bean know what methods the other beans have?). We should not have CMR fields in the remote component interface because CMR is not built for clients but rather for other beans.

*edit: spec 10.3
[ August 07, 2004: Message edited by: Ryan Wong ]
Dan T
Ranch Hand

Joined: Jun 15, 2004
Posts: 66
for A, B
spec 10.3.1:

The container-managed persistent fields and container-managed relationship fields must not be defined in the entity bean class.
Vijaya laxmi
Ranch Hand

Joined: Jan 14, 2004
Posts: 60
Hi Marco

There are mistakes in many mock exams everywhere.So better refer spec.Dont get confused in the last moment.So better know that there are mistakes and Just refer spec for your right ans with that in the spec.

Best Wishes

Vijaya


SCJP1.4,SCBCD1.3,SCWCD1.4(Preparing)
alzamabar
Ranch Hand

Joined: Jul 24, 2002
Posts: 379
Originally posted by Ryan Wong:
for A, B
spec 10.3.1:

The container-managed persistent fields and container-managed relationship fields must not be defined in the entity bean class.


Oh, thanks. I see it now.
alzamabar
Ranch Hand

Joined: Jul 24, 2002
Posts: 379
Originally posted by Vijaya Laxmi:
Hi Marco

There are mistakes in many mock exams everywhere.So better refer spec.Dont get confused in the last moment.So better know that there are mistakes and Just refer spec for your right ans with that in the spec.

Best Wishes

Vijaya



Thank you Vijaya. I read that you recently passed the exam, and that you suggested to look at other resources for EJB-QL and...What was the other thing? Could you suggest where to focus my attention in the specs? I'll have a go and read all the specs, but I wouldnt' rather study all of them.
Vijaya laxmi
Ranch Hand

Joined: Jan 14, 2004
Posts: 60
For EJB-QL I think spec and Mastering Enterprise JavaBeans Book may be enough.Spec I just read only which is given to be read by valentine cheat sheets.Any doubt I used to give a search in spec and used to read that topic.

All the best Vijaya
 
GeeCON Prague 2014
 
subject: Coffe Cream on EB: mistakes/doubts #1