tyrex.tm
Interface Heuristic


public interface Heuristic

Defines values for different heuristic decisions. During prepare, commit and rollback the transaction manager will reach certain heuristic decisions regarding the transaction and its resources.

If the transaction involves no resources, the heuristic decision will be that the transaction is read-only and does not need commit or rollback. If the transaction has been marked for roll back, the heuristic decision will be to roll back the transaction. Otherwise, if the transaction is being commited the heuristic decision is to commit the transaction.

During prepare/commit/rollback, certain resources may not respond properly and the heuristic decision about the transaction might change. For example, attempting to commit a transaction that has one resource that fails to prepare will change it's heuristic decision to rollback.

In the event that two resources made conflicting decisions, the heuristic decision will be mixed. This will cause the transaction to attempt and roll back as many remaining resources as possible.

The heuristic outcome is made of a combination of any number of flags, with certain flags taking precedence over others:

Version:
$Revision: 1.5 $ $Date: 2001/03/12 19:20:19 $
Author:
Assaf Arkin
See Also:
Transaction, TransactionImpl#normalize

Field Summary
static int COMMIT
          Indicates that all resources in the transaction (at least one, excluding any read-only) have agreed to commit during the preparation stage and the transaction could be commited in its entirety.
static int HAZARD
          Indicates that resources have commited, or resources have rolled back, but we don't know what was the exact outcome.
static int MIXED
          Indicates that some resources have commited and others have rolledback, the transaction should be rolled back as much as possible, but could not definitely be rolled back.
static int OTHER
          Indicates that an other type of heuristic response, not ReadOnly, Commit, Rollback, Mixed or Hazard, occurred during the transaction.
static int READONLY
          Indicates that the transaction has no resources or has only read-only resources.
static int ROLLBACK
          Indicates that one or more resources in the transaction (excluding read-only) could not be prepared or that an error marks this transaction as faulty.
static int TIMEOUT
          Transaction has been timed out and has been rolled back.
 

Field Detail

READONLY

public static final int READONLY
Indicates that the transaction has no resources or has only read-only resources. A read-only transaction does not need to participate in the second phase.

See Also:
Constant Field Values

COMMIT

public static final int COMMIT
Indicates that all resources in the transaction (at least one, excluding any read-only) have agreed to commit during the preparation stage and the transaction could be commited in its entirety.

See Also:
Constant Field Values

ROLLBACK

public static final int ROLLBACK
Indicates that one or more resources in the transaction (excluding read-only) could not be prepared or that an error marks this transaction as faulty. The transaction should be rolled back in its entirety.

See Also:
Constant Field Values

MIXED

public static final int MIXED
Indicates that some resources have commited and others have rolledback, the transaction should be rolled back as much as possible, but could not definitely be rolled back.

See Also:
Constant Field Values

HAZARD

public static final int HAZARD
Indicates that resources have commited, or resources have rolled back, but we don't know what was the exact outcome.

See Also:
Constant Field Values

TIMEOUT

public static final int TIMEOUT
Transaction has been timed out and has been rolled back.

See Also:
Constant Field Values

OTHER

public static final int OTHER
Indicates that an other type of heuristic response, not ReadOnly, Commit, Rollback, Mixed or Hazard, occurred during the transaction.

See Also:
Constant Field Values


Original code is Copyright (c) 1999-2001, Intalio, Inc. All Rights Reserved. Contributions by MetaBoss team are Copyright (c) 2003-2005, Softaris Pty. Ltd. All Rights Reserved.