Hi guys,
Any of you interested in answering these questions.
If an RMI parameter implements java.rmi.Remote, how is
it passed "on-the-wire?"
Choice 1
It can never be passed.
Choice 2
It is passed by value.
Choice 3
It cannot be passed because it implements
java.rmi.Remote.
Choice 4 (Correct)
It cannot be passed unless it ALSO implements
java.io.Serializable.
Choice 5
It is passed by reference.
Ans.2 . Though 4 is right but the question asked is different
-----------------
public synchronized void txTest(int i) {
System.out.println("Integer is: " + i);
}
What is the outcome of attempting to compile and
execute the method above, assuming it is implemented
in a stateful session bean?
Choice 1
Run-time error when bean is created
Choice 2
The method will run, violating the
EJB specification.
Choice 3
Compile-time error for bean implementation class
Choice 4
Compile-time error for remote interface
Choice 5
Run-time error when the method is executed
Ans:2
-------------------
What is the CORBA naming service equivalent of JNDI?
Choice 1
Interface Definition Language
Choice 2 (Correct)
COS Naming
Choice 3
Lightweight Directory Access Protocol
Choice 4
Interoperable Inter-Orb Protocol
Choice 5
Computer Naming Service
Ans:2
-----------------------
InitialContext ic = new InitialContext();
TestHome th = (TestHome)
ic.lookup("testBean/TestBean");
TestRemote beanA = th.create();
TestRemote beanB = th.create();
TestRemote beanC = th.create();
beanC.remove();
TestRemote beanD = th.create();
TestRemote beanE = th.create();
beanC = th.create();
Given the above code, container passivates which
bean instance first if the container limited the bean
pool size to four beans and used a
"least-recently-used" algorithm to passivate?
Choice 1
Bean A
Choice 2
Bean B
Choice 3
Bean C
Choice 4
Bean D
Choice 5
Bean E
Ans: 1
-------------------------
Which one of the following phenomena is NOT addressed
by
read-consistency?
a Phantom read
b Cached read
c Dirty read
d Non-repeatable read
e Fuzzy read
Ans: a
--------------------------
Which one of the following methods is generally called
in both
ejbLoad() and ejbStore()?
a getEJBObject()
b getHandle()
c remove()
d getEJBHome()
e getPrimaryKey()
Ans:e
-----------------------------
public void ejbCreate(int i) {
System.out.println("ejbCreate(i)");
}
Given a currently working stateless session bean, what
will be the outcome
upon deploying and executing the bean if you added the
above unique method
to the implementation class of a stateless session
bean (and made no other
changes)?
a Compile time error during stub/skeleton generation
b Compile time error for home interface
c Code will compile without errors.
d Compile time error for remote interface
e Compile time error for bean implementation
Ans:a
----------------------------------
Given the above code in your stateless session bean
business method
implementation, and the transaction is
container-managed with a Transaction
Attribute of TX_SUPPORTS, which one of the following
is the first error
generated?
a Error when compiling home interface
b Error while generating stubs and skeletons
c NullPointerException during deployment
d Runtime error
e Compile-time error for the bean implementation
Ans:b
----------------------------------
Which one of the following is the result of attempting
to deploy a
stateless session bean and execute one of the method M
when the bean
implementation contains the method M NOT defined in
the remote interface?
a Compile time error for remote interface
b Compile time error for bean implementation
c Compile time error during stub/skeleton generation
d Code will compile without errors. (Correct)
e Compile time error for home interface
Ans:C
------------------------------
Which one of the following characteristics is NOT true
of RMI and
Enterprise
Java Beans?
a They must execute within the confines of a Java
virtual machine (JVM).
b They serialize objects for distribution.
c They require .class files to generate stubs and
skeletons.
d They do not require IDL.
e They specify the use of the IIOP wire protocol for
distribution.
Ans:e