Specifying Conflict Resolution

From InterBase

Go Up to Creating a Transaction Parameter Buffer

The conflict resolution parameter describes what happens if a transaction encounters an access conflict during an update or delete operation. There are two possible choices for this parameter:

  • isc_tpb_wait, the default, specifies that the transaction should wait until resources are released. Once the resources are released, the transaction retries its operation. If the conflicting transaction is committed, the waiting transaction receives an update conflict error. If the conflicting transaction is rolled back, the waiting transaction proceeds without an error.
  • isc_tpb_nowait specifies that the transaction should return an update conflict error without waiting for resources to be released. This mode can lead to “live locks” if the transaction that received the error retries its operation again, only to fail again because the resources are still locked.

The following declaration creates a TPB with write access, a concurrency isolation mode, and a conflict resolution of isc_tpb_nowait:

static char isc_tpb[] = {isc_tpb_version3,

A TPB should only specify one conflict resolution parameter. If more than one is specified, later declarations override earlier ones. If a TPB is declared that omits the conflict resolution parameter, InterBase interprets it as isc_tpb_concurrency.

Advance To: