Tuesday, 19 April 2016

What are transaction attributes ?


The transaction attribute specifies how the Container must manage transactions for a method when a client invokes the method via the enterprise bean’s home or component interface or when the method is invoked as the result of the arrival of a JMS message.

Below is a list of transactional attributes : 

1. NotSupported
Transaction context is unspecified.

2. Required
Bean's method invocation is made within a transactional context.
If a client is not associated with a transaction, a new transaction is invoked automatically.

3. Supports
If a transactional context exists, a Container acts like the transaction attribute is Required, else - like NotSupported.

4. RequiresNew
A method is invoked in a new transaction context.

5. Mandatory
If a transactional context exists, a Container acts like the transaction attribute is Required,
else it throws a javax.ejb.TransactionRequiredException.

6. Never
A method executes only if no transaction context is specified.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.