Tag: architecture

Questions Related to architecture

You have defined transaction attributes for a particular method in the session bean class through annotations. You defined a different value in the deployment descriptor. If you have defined at both the places for a particular method, which settings take precedence?

  1. Annotations

  2. Deployment descriptor

  3. This is not possible as you cannot use both.

  4. It is specific to application server product


Correct Option: B

When should you use a Stateful Session Bean?

  1. When fetching frequently used read-only data.

  2. If you need to manage the workflow or several EJBs.

  3. At any time, multiple clients can have access to the bean instance.

  4. When the bean should represent a business entity.

  5. The bean needs to hold data about the client across multiple invocations.

  6. To asynchronously receive JMS messages.


Correct Option: B,E

When should you use a Session Bean?

  1. At any time, only one client has access to the bean instance

  2. At any time, multiple clients can have access to the bean instance

  3. When the bean should represent a business entity

  4. The bean is not required to be persistent

  5. To synchronously receive JMS messages

  6. To asynchronously receive JMS messages


Correct Option: A,D,E

EJB 3.0 offers simplified entity programming model. Which of the following describe these new simplified features with regard to EJB 3.0 and Java Persistence API?

  1. In EJB 3.0, persistent fields must be identified through deployment descriptor.

  2. The persistent state of an entity is represented either by its persistent fields or persistent properties.

  3. For an EJB 3.0 entity, you no longer need to code interfaces such as LocalAddressHome and LocalAddress.

  4. In the Java Persistence API, you do not not need to provide an XML descriptor to specify an entity's primary key.

  5. Java Persistence API is simplified by removing support for complex relationships between Entities.


Correct Option: B,C,D

There is an excellent open-source ORM framework available in the market. Your team suggests using this new framework. Which of the following is the main disadvantage of using this new framework?

  1. Application can be isolated from the database and the only connection to it is using the ORM framework and a JDBC driver.

  2. Developer productivity increases.

  3. Performance will be slower than direct JDBC connections.

  4. Application maintainance may be a problem.


Correct Option: D

Which two statements are FALSE about implementing web services utilizing the Java EE programming model?

  1. Supports the processing of XML content, data binding, and the development SOAP based and RESTful Web Services.

  2. Web Services exposed by JAX-WS can only be of type document/literal.

  3. Stateless session beans cannot be exposed as web services using Java EE technology.

  4. JAX-WS greatly simplifies the web service implementation model.


Correct Option: B,C

You are building a Java EE Stateless Session Bean with remote interfaces which you also would like to expose as a web service. Which of the following is false?

  1. When EJB is called by client, parameters will be passed by reference

  2. Methods must have RMI-IIOP compatible parameters and return types

  3. Methods must have JAXB compatible parameters and return types

  4. Use annotation @WebService and @WebMethod for deployment.


Correct Option: A

You would like to measure the performance (response time) of a particular business method of EJB3.0 Session Bean. Which of the following facilitates the same?

  1. Dependency Injection

  2. Interceptors

  3. Intercepting Filter Pattern

  4. None of the above. You need to write code for measuring response times.


Correct Option: B
  1. You must write ejbPassivate() method. Shift the logic to this method.

  2. Mention the method name in the deployment descriptor

  3. Use annotations

  4. There is no such facility in EJB3.0


Correct Option: C

Which of the properties in the list below are unique to Enterprise JavaBeans but not for JavaBeans?

  1. They are components.

  2. A container manages them.

  3. More than one of them can be combined in a single program (not application).

  4. They live on the server side of an application.

  5. They can be part of a transaction.


Correct Option: B,D,E