• 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
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Mock Exam HF EJB

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
In HF EJB Book on Page 368 & 369
Question 5 Which are legal declaration for a CMP bean's ejbCreate methods?
A. public void ejbCreateBigCustomer() throws javax.ejb.CreateException
B. public String ejbCreateAccount() throws javax.ejb.CreateException
C. static String ejbCreate() throws javax.ejb.CreateException
D. public int ejbCreate() throws javax.ejb.CreateException
E. public final String ejbCreate() throws javax.ejb.CreateException
According to Book Option B is the right answer but I think right answer is B and D both.
Same as in
Question 9 Which method(s) from EntityContext interface can be invoked from within the ejbCreate method?
A. getEJBHome()
B. getEJBObject()
C. getCallerPrinciple()
D. getUserTransaction()
E. setRollbackOnly()
According to book right answer is A,B,C,E.
and I think for this A,C and E are the right answer.
Please put some shed on it if i'm wrong.
Regards,
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,
the answer to question 5 is indeed only option B.
The thing is that the ejbCreate should return the primary key class and a primitive is not valid for this.
You can explicitly see this in the signature of the getPrimaryKey method:
public Object getPrimaryKey() throws RemoteException which returns an Object.
I think you are right concerning question 9.
 
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question :5
See Spec p: 172
public PrimaryKeyClass ejbCreate<METHOD>(...);
- the return value is a class and not a primitive.

Question :9
see Spec p:179 (Table 4).
There is no getEJBObject() or getUserTransaction() method in the list of allowed operations. Moreover Kathy has mentioned in the thread ...
https://coderanch.com/t/158300/java-EJB-SCBCD/certification/ejbCreate
that getEJBObject() method can be called only in the stateless/stateful session beans and not in entity beans.
I also think that this is an error.
[ November 28, 2003: Message edited by: Vish Kumar ]
 
I'm gonna teach you a lesson! Start by looking at this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic