There is no default transaction attribute for an EJB.

Options
- False
- True


CORRECT ANSWER : True

Discussion Board
Transaction attribute

It is correct that there is no default transaction attribute however there is enum TranstactionAttributeType which is used with the TransactionAttribute to specify whether the methods of a session bean or message driven bean are called with a valid transaction context or not. Different states can be used for different beans and they are as follows:

1) REQUIRED and NOT_SUPPORTED values are used for a message-driven bean's message listener methods (or interface).

2) REQUIRED, REQUIRES_NEW and NOT_SUPPORTED values are used for an enterprise bean's timeout callback methods.

3) REQUIRED, REQUIRES_NEW, and NOT_SUPPORTED values are used for a session bean's asynchronous business methods.

4) REQUIRED, REQUIRES_NEW, and NOT_SUPPORTED values are used for a singleton session bean's PostConstruct and PreDestroy lifecycle callback interceptor methods.

Rohit Sharma 08-14-2014 07:46 PM

Stateless Session Bean

Stateless Session Beans doesn't have a conversational state with the client or they don't maintain a session with the client. When a client invokes a method then the stateless bean consists of instance variable only for that client for certain particular time. When the methods is finished for that client then the state for that client also ends. All instances of stateless bean except during method invocation, are equivalent, allowing the EJB container to assign an instance to any client. State of stateless bean is being transferred to all the clients.

It provides better scalability for applications which requires large number of clients. It can also be used to implement a web service that a stateful bean cannot.

Rohit Sharma 08-14-2014 07:39 PM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement