Transaction policies are also defined in the component's deployment description. Based on the policy, the container makes the proper Transaction service calls. The supported transaction policies are:
-
not-supported : If the client does not provide a current transaction, the operation is invoked. If the client provides a current transaction, then container suspends it before the method execution and resumes after the method execution completes.
-
required : The component's method is executed in the transaction and completes successfully if the transaction ends successfully. Container will define a transaction if the client does not provide one.
-
supports : The method invocation is executed in the transaction if the client provide one. If no transaction is provided, then the method is executed without any transaction context.
-
mandatory : the client should provide a transaction before the invocation.
-
never : the client should not be in the current transaction to execute the method.
|