Sie sind auf Seite 1von 6

1.

Choose the incorrect statement from the following about Home methods in a bean class for CMP
(Container Managed Persistence).
The throws clause of the method may include the java.rmi.RemoteException.
Relationships must not be accessed by the method
The persistence state of the bean must not be accessed by the method
The static declaration can not be done for the method.
CORRECT ANSWER : The throws clause of the method may include the java.rmi.RemoteException.
2. The EJB Transaction Attribute that ensures the method call that always takes place in a transaction,
either client started or container started are
TX_SUPPORTS
TX_MANDATORY
TX_REQUIRED and TX_REQUIRES_NEW
Either A or B
CORRECT ANSWER : TX_REQUIRED and TX_REQUIRES_NEW
3. What will be returned by the method ejbCreate() CMP bean?
null
Primary Key class
Home Object
Remote Object
CORRECT ANSWER : null
4. When a session bean has container-managed demarcation value of 'Supports', which three methods
run in an unspecified transaction context?
1. ejbActivate
2. getRollbackOnly
3. getUserTransaction
4. ejbRemove
5. afterBegin

6. afterCompletion
1,4,3
4,2,6
1,4,6
2,5,6
CORRECT ANSWER : 1,4,6
5. Upon invoking getRollbackOnly() method by a business method in an entity bean, which transaction
attribute settings will lead the ejb container to throw an exception?
Required
RequiresNew
Never
Mandatory
CORRECT ANSWER : Never
6. Which two of the following must be included in every ejb-jar file?
1. Stubs for the EJBHome and EJBObject interface.
2. The JAR Manifest file.
3. A deployment descriptor.
4. The JNDI context.
5. The EJB's home interface.
1 and 3
2 and 5
3 and 5
4 and 2
CORRECT ANSWER : 3 and 5
7. Which of the following can be directly invoked by the client?

ejbPassivate
business methods
setSessionContext
newInstance
CORRECT ANSWER : business methods
8. Which statements about a session bean class are true?
It is a final class
Overloaded constructors are supported
Their business methods can be 'private'
The ejbCreate() method must not be a final method
CORRECT ANSWER : The ejbCreate() method must not be a final method
9. Which of the following is true about EJB transactions?
Nested transactions are supported by EJB 2.0
Isolation levels specification is supported by EJB 2.0
Bean-managed transaction demarcation must not be used in Message-driven beans
Bean-managed transaction demarcation must not be used in Entity beans
CORRECT ANSWER : Bean-managed transaction demarcation must not be used in Entity beans
10. Given the following code in a stateful session bean business method;
try {
Socket skt = new Socket(x,y);
} catch (Exception ex) {
ex.printStackTrace();
}
assuming that x and y are the port and IP addresses respectively of a running service, which is running
on the same server, which of the following is correct?

Failure in Compilation
Failure in Deployment
An exception is thrown at runtime
Indeterminate. The code is not guaranteed to be ported to all EJB 2.0 container, though it may deploy.
CORRECT ANSWER : Indeterminate. The code is not guaranteed to be ported to all EJB 2.0 container,
though it may deploy.
11. Stateful Session beans contain
Home Interface
Remote Interface
Bean class
All of the above
CORRECT ANSWER : All of the above
12. Which of the following regarding business methods in a bean class is incorrect?
Both session bean and entity bean business business methods are always same
For Java RMI API, the argument and return types must always be legal types
The throws clause may include any exceptions defined by your application.
None of the above
CORRECT ANSWER : For Java RMI API, the argument and return types must always be legal types
13. EJB systems performance tuning is the responsibility of
Bean Provider
EJB Deployer
Application Assembler
Tool Vendor
CORRECT ANSWER : EJB Deployer
14. Which is the method available in SessionContext interface?

afterBegin()
getRollbackOnly()
setSessionCotext()
getUserTransaction()
CORRECT ANSWER : setSessionCotext()
15. Which of the following is not a life-cycle method for a Stateful Session Bean?
Post Construction
Pre Destruction
Post Activation
Pre Construction
CORRECT ANSWER : Pre Construction
16. From the following APIs, which API does NOT guarantees to be supported by EJB 2.0 containers?
JAXP
JNDI
JXTA
JDBC
CORRECT ANSWER : JXTA
17. Which statement about session beans is true?
In both stateless and statefull session classes, the bean provider must write the method public void
remove()
The method << remove >> in the component interface can be accessed only by the remote clients
The beans handle must be provided by the client, in order to ask the EJBHome for removing a session
bean
None of the above
CORRECT ANSWER : The beans handle must be provided by the client, in order to ask the EJBHome for
removing a session bean
18. Which of the following are guaranteed capabilities of EJB 2.0?

Run-as security identity functionality.


The extension of JDBC 2.0
Both A and B
Neither A nor B
CORRECT ANSWER : Both A and B
19. Which of the following is true ?
Preserving of any state across method calls does not performed by Stateless session beans
Multiple users can access Stateful session beans at the same time
Both are correct
CORRECT ANSWER : Preserving of any state across method calls does not performed by Stateless session
beans
20. Which two of the following is responsible to creates ejb-jar files?
1. The bean provider.
2. The application assembler.
3. The deployer.
4. The system administrator.
1 and 2
2 and 3
3 and 4
4 and 1
CORRECT ANSWER : 1 and 2

Das könnte Ihnen auch gefallen