• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

SCBCD Mock Q's - Batch 2

 
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Some more fodder for the beta studiers
Remember: It's not an open book test!
IMPORTANT NOTE: I cheated a little by saying 'choose all that apply'. On the real exam you will ALWAYS be told how many answers are correct, I just wanted to toughen it up a little
1 Which statement about session beans is true?
a). The bean provider must write the method public void remove() in both stateless and stateful session classes.
b). Local clients can remove session beans by calling a method on the bean's home.
c). The ejbRemove() method in the component interface can be used only by remote clients.
d). To ask the EJBHome to remove a session bean, the client must provide the bean's handle.

2 Which statement about locating or using a session bean's home interface is true?
a). Acquiring an 'InitialContext' is required only for remote clients.
b). The 'InitialContext' must be narrowed before it can be used.
c). Once acquired by a client, a home interface can be used multiple times.
d). The client can acquire a handle for the bean's local home interface.

3 When comparing two session objects, what is true? (Choose all that apply.)
a). Using the 'isIdentical' method, stateless session beans from the same home will always return true.
b). Using the 'isIdentical' method, stateful session beans from the same home will always return true.
c). The 'isIdentical' method can be used only for remote object references.
d). Using the 'equals' method, stateless session beans from the same home will always return true.
e). Using the 'equals' method, stateful session beans from the same home will always return true.

4 Which method can be called by both remote and local clients on a reference to a session bean's component interface?
a). ejbCreate
b). getSessionContext
c). getPrimaryKey
d). getEJBHome
e). remove
 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My answers are:
1. b
2. (assuming referring to remote home interface)
b,c
3. a
4. c,e
 
Hung Tang
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


4. c,e


change answer to
4. c,d,e
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My answers:
1. d
2. c
3. a
4. e
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Dennis Shi:
My answers:
1. d
2. c
3. a
4. e


I agree with Dennis' answers except for the 4th question. My answer for it is (C and E) because getPrimaryKey() can be called by both remote and local objects even though exceptions will be thrown.
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1 Which statement about session beans is true?
a). The bean provider must write the method public void remove() in both stateless and stateful session classes.
False. Usually implemented by container.
b). Local clients can remove session beans by calling a method on the bean's home.
False. To remove beans via home, can use either remove(Handle handle) or remove(Object PK). However local clients cannot get handles, therefore remove(Handle handle)is out. Remove(Object PK) can only be used by entity beans since session beans do not have PK.
c). The ejbRemove() method in the component interface can be used only by remote clients.
False. ejbRemove() is defined in session bean class and not in component interface.
d). To ask the EJBHome to remove a session bean, the client must provide the bean's handle.
True. Explanation in b). remove(Handle handle) is applicable to remote home.
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Only entity beans have primary keys. So c is not a correct choice.

Originally posted by sh yh:

I agree with Dennis' answers except for the 4th question. My answer for it is (C and E) because getPrimaryKey() can be called by both remote and local objects even though exceptions will be thrown.

 
sh yh
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Pradeep Bhat:
Only entity beans have primary keys. So c is not a correct choice.


Yes, only entity beans have primary keys, but C is still a correct choice. Because you CAN still call the method getPrimaryKey even though it doesn't have a primary key. Remember, the question asked whethere or not you "CAN" call the method, the question didn't ask you if there is a primary key.
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I agree with you
 
Bert Bates
author
Posts: 9050
21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think the question should be reworded, how about:
Which method can be called without exception, by both...
- or -
Which method can be successfully called, by both...

I guess I prefer the first alternate, any thoughts?
-Bert
 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
component interface means remote component interface. So I think d) is also right answer!
 
Forrest Xu
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
4 Which method can be called by both remote and local clients on a reference to a session bean's component interface?
a). ejbCreate
b). getSessionContext
c). getPrimaryKey
d). getEJBHome
e). remove
Sorry I think It should be D,E, since component interface is remote component interface which can be used for by local or remote client.(Normally we define remote component interface as component interface and local component interface as local component interface).local client means the same VMS with the session bean. Remote component interface can be called by local bean client but not vice versa. So d) is OK!
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My answers:
1. d
2. c
3. a
4. c d e
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic