Top 150+ Solved Enterprise Computing With JAVA MCQ Questions Answer
Q. The EJB Transaction Attribute that ensures the method call that always takes place in a transaction, either client started or container started’ are
a. TX_SUPPORTS
b. TX_MANDATORY
c. TX_REQUIRED and TX_REQUIRES_NEW
d. Either A or B
Q. JMS is mainly used to send and receive message from one application to another.
a. True
b. False
c. none
d. all
Q. Abbreviate the term JMS?
a. Java Message Service
b. Java Monitor Service
c. Java Message Session
d. Java Monitor Session
Q. A message driven bean is like statefull session bean that encapsulates the business logicand doesn't maintain state.
a. True
b. False
c. none
d. all
Q. Which case of a session bean obtains the UserTransaction object via the EJBContext using the getUserTransaction() method in EJB transaction management?
a. Bean-managed transactions
b. Container-managed transactions
c. Both A & B
d. None of the above
Q. Which services are provided to EJB components by the EJB container?
a. Transaction support
b. Persistence support
c. Naming support
d. All mentioned above
Q. Which EJB container must provide an implementation of Java Naming and Directory Interface (JNDI) API to provide naming services for EJB clients and components?
a. Transaction support
b. Persistence support
c. Naming support
d. All mentioned above
Q. Which session bean maintain their state between client invocations but are not required to maintain their state across server crashes or shutdowns?
a. Stateful Session Bean
b. Stateless Session Bean
c. Singleton Session Bean
d. None of the above
Q. A session bean represents a multiple clients inside the Application Server.
a. True
b. False
c. none
d. all
Q. EJB is a specification for J2EE server, not a product; Java beans may be a graphical component in IDE.
a. True
b. False
c. none
d. all
Q. Which statement characterizes stateless session beans?
a. They allow the PostConstruct, PreDestroy, and PrePassivate life-cycle callbacks.
b. They require home interfaces.
c. When a client looks up a stateful session bean in the JNDI, the same bean is returned every time.
d. They are asynchronous message consumers.
Q. A message-driven bean can have an instance of a MessageDrivenContext injected. Which method can be successfully invoked on this interface from a message-driven bean?
a. getEJBHome
b. getCallerPrincipal (*)
c. isCallerInRole
d. getEJBLocalHome
Q. Which statement about entities is correct?
a. Entities must be annotated with the @Entity annotation.
b. Entities can be final classes.
c. Entities can have a single no-arg constructor with protected visibility.
d. Instance variables of an entity can have private, protected, public, or package visibility.