Skip navigation links

Java API Reference for Oracle Infrastructure Web Services
11
Release 1 (11.1.1)

E10654-04


oracle.webservices.annotations.async
Annotation Type Retry


@Retention(value=RUNTIME)
@Target(value={TYPE,METHOD})
public @interface Retry

This annotation is used to control the behavior of the retry mechanism while processing the asynchronous request from the queue. In case of abnormal termination of the request processing, it may or may not be safe to retry the operation depending on whether it has any side effects or not.

If the method is not idempotent, the retry mechanism should be disabled by setting "enable=false".

The absence of this annotation implies that the method is idempotent. By default, all methods are idempotent.

If the method is idempotent, it implies that there is no side effect of calling this method more than once. In case the execution of this method results in an abnormal termination, system will retry this method from the beginning as it is safe to do so.

If the method can participate in a global transaction, the system can achieve the non-idempotent behavior in the most reliable way. The execution of the method and the posting of the response, both are done under one global transaction. If any of the steps result in an abnormal termination, the transaction will be rolled back and the method will be executed again in a new transaction. In this case it is guaranteed that the method will be executed only once in a completed transaction and the result of the execution will always be posted only once to the response queue.

If the method cannot participate in a global transaction, then the system will guarantee that the non-idempotent method is executed "at most once". If the method execution does not complete because of some abnormal termination, a fault response will be sent to the callback service. If there is an abnormal termination after completely executing the method but before/while posting the response to the queue then also a fault message will be sent to the callback service.

If this annotation is applied to the class, all the methods inherit the setting. If a method has its own annotation, then the class level annotation ignored.


Optional Element Summary
 boolean enable
          Indicates if this method can be safely retried in case of abnormal termination during the execution of this method.
 boolean supportsGlobalTransaction
          Indicates if this method is capable of participating in the global transaction or not.

 

enable

public abstract boolean enable
Indicates if this method can be safely retried in case of abnormal termination during the execution of this method. For idempotent methods set this flag to true. If the method is not idempotent, set this flag to false. Consider supporting global transaction for the best way to achieve this. In the absence of this annotation, the default value is false. If the annotation is present then the the default value is true.
Returns:
Default:
true

supportsGlobalTransaction

public abstract boolean supportsGlobalTransaction
Indicates if this method is capable of participating in the global transaction or not. The value of this field is used only if there are no other annotations specifying this behavior. For example if there is an annotation of the type javax.ejb.TransactionAttribute or the equivalent WS_AT annotations, and the transaction attribute type is "Required", "Mandatory" and "Supports" then the method is assumed to participate in the global transaction. Other values like "RequiresNew", "NotSupported" and "Never" imply that it cannot participate in the global transaction. In case of POJO based services, this field can be set to indicate if this method can participate in the global transaction or not. If this field is specified in addition to the EJB transaction attribute annotations, it should be matching. If the method can participate in the global transaction, system can manage the retry mechanism in a completely reliable manner. Otherwise system will try it's best to achieve the same. Refer to the general description of this class for the details.
Returns:
true if method can participate in the global transaction
Default:
false

Skip navigation links

Java API Reference for Oracle Infrastructure Web Services
11
Release 1 (11.1.1)

E10654-04


Copyright © 2006, 2010, Oracle and/or its affiliates. All rights reserved..