• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Coffe Cream on EB: mistakes/doubts #1

 
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!!
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
It's hard to fight evil. The little things, like a nice sandwich, really helps. Right tiny ad?
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic