Hi Herve....
I agree with venkata.....
1. "Select the distributed object protocol from following" (5th question)
there is no protocol like RMI-JRMP. Java RMI uses JRMP protocol for performaing c/s communications. For 5th qtn I think the ans is c....
Regarding the 10th qtn... I think again venkata is right... but anyways will have to have another opinion....
-----------------------------------------------------------------
Here are some of the other qtns....
An EJB client has no current transaction. It invokes the business method of an
EJB using container-managed transaction demarcation.
The business method executes within the scope of a transaction.
Which of the following are possible values for the bean method's transaction attribute?
a)NotSupported
b)Supports
c)Required
d)RequiresNew
e)Mandatory
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
ans is c and d
d)RequiredNew :- if there is a transaction already runnning the transaction is suspended
otherwise a new transaction is started
c) Required :- Required to be used when a bean has to always run in a transation.
If a transaction is already running then the bean joins it
else a new transaction is started
Which one of the following statements describes the design that BEST leverages the J2EE architecture?
a)Clients install Swing components on their system which interact via RMI with EJBs on the server, EJBs interact with
backend services such as databases.
b)Clients view applets in web browsers, servlets service the client requests on the server and interact with backend
services such as databases.
c)Clients view HTML in web browsers,
JSP pages service the client requests and interact with EJBs on the server,
EJBs interact with backend services such as databases.
d)Clients view HTML in web browsers, CGI scripts service the client requests on the server and interact with EJBs on
the server, EJBs interact with backend services such as databases.
Single Select - Please select the best answer (one and only one choice must be selected).
This one is obvious.
C
An instance of the Person class, whose definition is given below, is returned from a remote method invocation in RMI.
An exception is thrown. Why?
public class Person extends Object {
private
String name;
public String getName()
{
return name;
}
public String setName(String newName)
{
name = newName;
}
}
a) Person does not implement the java.io.Serializable interface
b) Person does not implement the RemotePerson interface
c) The class was not precompiled with rmic
d) The class does not extend java.rmi.server.UnicastRemoteObject}
Single Select - Please select the best answer (one and only one choice must be selected).
The answer is a. To be passed via RMI the class, and its components, must be serializable.
Two programs, ProgramA and ProgramB, access the same database table concurrently. Both programs connect to the
database with a transaction isolation level of TRANSACTION_READ_COMMITTED. ProgramA begins a multiple row update but
has not yet committed its changes. At the same time ProgramB selects a row that has been modified by ProgramA. What
happens?
a) ProgramA receives an SQLException
b) ProgramB receives an SQLException
c) ProgramB reads the row and continues
d) ProgramB blocks until ProgramA commits or rolls back
e) A deadlock occurs
D is the right answer. B will block. READ_COMMITTED prevents B from reading data that another program may be updating.
Since A and B both are marked as TRANSACTION_READ_COMMITTED, will read only committed data
ie will eliminate dirty read. And since the program A has begun it's update and
not committed yet and at the same time program B selects a row that A has modified
but not committed, will not read be B. Program will have to wait until the Program A
committs or rollsback.
Most web applications require logic for validating form input and determining the
next page to display. Given long term maintenance and reuse objectives,
what is the BEST design to implement this logic?
a) A JSP that both validates form input and determines the next page.
b) Validate form input in a JSP and determine the next page in a servlet.
c) Validate form input in a servlet and determine the next page in a JSP.
d) A servlet both validates form input and determines the next page.
Single Select - Please select the best answer (one and only one choice must be selected).
Can someone say the answer for this one and also the xplanation for the same !!
Which of the following is true concerning the use of UserTransaction?
a) Stateless Session beans must start and end a UserTransaction within one method, since they service multiple
clients.
b) Stateful Session beans must start and end a UserTransaction within one method, since they service multiple
clients.
c) A UserTransaction for stateless Session beans can span methods, since they service only one client.
d) A UserTransaction for stateful Session beans can span methods, since they service only one client.
I pick a & d.
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
A developer is using a DBConnectionPool to work with a database. While running, a DBException is thrown.
What are possible causes?
a) The pool has reached its maximum number of connections and cannot create more.
b) No maximum was specified for the pool
c) The pool needs to be reinitialized
d) The pool was not initialized
I pick d
In deployment descriptors, security roles and method permissions:
a) can be shared across EJBs.
b) can utilize wildcard characters to authorize multiple methods at one time.
c) can be defined during deployment.
d) are mapped to actual user groups during deployment.
I pick b, c
a is ruled out ... method permissions cannot be shared..
Multiple Select - Please select all of the correct answers (this question has 3 correct choices).
public synchronized void fixMe()
{
Sysmtem.out.println("EJB prohibits the use of synchronized keyword");
}
a) The method will run
b) Run time error after ejbCreate()
c) compile time error for remote interface
d) Run time error when the method is executed
e) compile time error for bean implementation class
I pick c but e seems to be the correct answer to.
Vidya
1. An applet will directly accesses Database using
JDBC. No database installation (or) configuration is
to be perform on client workstations which JDBC driver
used in this situation.
a) Type-1 JDBC-ODBC Bridge Driver
This is ruled out as this requires ODBC configuration on client machine.
b) Type-2 Native API partly Java Driver
this is also ruled out as applet cannot access native code.
c) Type-3 JDBC-Net pure Java Driver
This is correct as the driver is dynamically downloaded
d) Type-4 Native protocol pure Java Driver
This is ruled out for the reason mentioned for b.
e) Type-5 Standard internet driver
This is wrong as there is not such driver as this.