15.00 - Within-Transaction Integrity Issues - Teradata Database

Teradata Database Design

prodname
Teradata Database
vrm_release
15.00
category
User Guide
featnum
B035-1094-015K

Within‑Transaction Integrity Issues

“Between‑Transaction Integrity Issues” on page 658 describes the integrity risks presented by concurrent updating of a table by different transactions. This topic describes the risks associated with cursor conflicts that occur within an individual transaction.

Cursor conflicts occur in the following situations:

  • Two cursors are open on the same table at the same time. One attempts a positioned update, but the other has already made a positioned update on the same row, thereby modifying the table.
  • While a cursor is open, a searched update is made on a row, and then the cursor attempts a positioned update on that row.
  • While a cursor is open, a positioned update is made on a row through that cursor and then a searched update is attempted on the same row.
  • All three of these updates are dirty because the same row was updated twice without the transaction having been committed.

    Note that the system permits all three of the dirty updates to occur and then returns a cursor conflict warning to the requesting program. Resolution of the integrity breach is left to the user.

    Because of the multiple possible integrity risks associated with declaring and opening multiple cursors within the same transaction, you should code your applications so those risks cannot occur.