Retrying After Transient Errors (PL/SQL)

TimesTen automatically resolves most transient errors (which is particularly important for TimesTen Scaleout).

However, if your application detects the following error, it is suggested to retry the failing transaction:

  • ORA-57005: Transient transaction failure due to unavailability of resource. Roll back the transaction and try it again.

Note:

Search the entire error stack for errors returning these error types before deciding whether it is appropriate to retry.

Using the PL/SQL pragma EXCEPTION_INIT, declare an exception to correspond to this error, and retry the transaction when the exception is encountered.

Here is an example:

declare
  retry_stmt exception;
  pragma exception_init(retry_stmt, -57007);
  retry_txn exception;
  pragma exception_init(retry_txn, -57005);
begin
  -- Execute SQL
exception
when retry_stmt then
  -- Re-execute the failing SQL statemment
when retry_txn then
  -- Re-execute the failing transaction
end;