Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Mock question

 
Ranch Hand
Posts: 143
  • 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 ]
 
Ranch Hand
Posts: 151
  • 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
  • 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
 
Ranch Hand
Posts: 1683
  • 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.
 
Eat that pie! EAT IT! Now read this tiny ad. READ IT!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic