• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

some doubts on mock exam questions

 
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
here is a question from ejbCertificate.com

Which of the following statements are correct about the responsibilities of the EJB container?
1.When the container invokes the ejbRemove() method the container removes immediately the entity from the database.
2.The container synchronizes the instance's state before it invokes the ejbRemove() method and uses the ejbLoad() method.
3.The container is responsible for providing the implementation of the ejbFind() methods.
4.After the ejbHome() method completes, the instance remains in the ready state.
5.he container is responsible for calling the ejbCreate() method.

The correct answer is 2,3,5. I did not choose 2 because I think there is no point to update entity bean from the underline database since it's about to be deleted. No matter the entity bean's data is updated or stale, its about to be delete, why bother to update it before its about to be deleted? Am I right?



Another question from Whizlabs:

____ is the method that must always be declared in the (local or remote)home interface of an entity bean. (write only the method name)

I wrote: remove
but the answer is findByPrimaryKey. Isn't this answer should apply to component interface instead of home interface? Please someone judge my answer.

Is this correct:
ejbFindByPrimaryKey and other ejbFind methods return primary key?
 
Author & Gold Digger
Posts: 7617
6
IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Regarding the first question, option 2 is correct. Please see section 10.5.3 of the EJB specification for confirmation.

As for the Whizlabs question, the given answer is correct. Please refer to sections 9.5.2 and 9.6.2 of the EJB specification.

Regarding your last question, the ejbFind methods in the entity bean class, they always return the primary key or a collection thereof. See section 10.7.3 of the EJB specification.
[ March 12, 2006: Message edited by: Valentin Crettaz ]
 
reubin haz
Ranch Hand
Posts: 287
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply.

But for the method declared in the both local and remote home interface also have: remove(Object pk), isn't this also right?
 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
remove(Object pk) - Is not actually declared by the Home Interface, but by its super interface. But it does declare the findByPrimaryKey.
 
What are you saying? I thought you said that Santa gave you that. And this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic