Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mock question

 
Sudhir V
Ranch Hand
Posts: 143
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Given this code:
try {
Advice a = aHome.create();
Handle aHandle = a.getHandle();
} catch (Exception ex) {...}
which are true? (assume everything compiles and works correctly)
A) aHandle must be Serializable.
B) Advice must extend EJBHome
C) The object referenced by aHandle is from a class implemented by the container
D) The Bean Provider implemented the aHome.create() method.
E) getHandle() declares a RemoteException
F) Handle extends java.rmi.Remote
G) The object referenced by 'a' IS-A java.rmi.Remote
2) Which are true about Session bean passivation?
A) Passivation always uses Serialization.
B) A bean can be removed even while in a passivated state.
C) A bean can be passivated even while in a transaction.
D) Both stateless and stateful session beans can be passivated.
E) A UserTransaction reference cannot be passivated.
F) A 'Connection' reference cannot be passivated.
G) A resource manager connection factory reference cannot be passivated.
H) A reference to a bean's privated JNDI environment can be passivated.
I) A null reference can be passivated.
J) Under some circumstances, the bean might be passivated *without* getting an ejbPassivate method call.
I think the answers shud be
1) A, C, E, G.
2) B, F, H, I
[ February 22, 2004: Message edited by: Sudhir Vallam ]
 
Prasad Kuppa
Ranch Hand
Posts: 151
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the answer :
G) The object referenced by 'a' IS-A java.rmi.Remote
for question 1 is incorrect. because Handle is not a Remote. ( it does not extend java.rmi.Remote).
Prasad
 
Sudhir V
Ranch Hand
Posts: 143
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But does'nt 'a' refer to the remote component interface which indirectly extends java.rmi.remote from javax.ejb.EJBObject
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Initially, I thought that 1 (B) was right, but then I remembered that the Home interface must extend either EJBHome or EJBLocalHome.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic