OpenTP1 Version 7 Programming Guide

[Contents][Index][Back][Next]

4.2.5 Relationship between transactions and TAM access

If a TAM access error occurs in a transaction branch, call the abort() from the UAP in order to terminate the global transaction process abnormally.

Even if access is made to records in the same global transaction, an error might be returned upon access to a record. This is caused by the function called for the previous access. Also, even when access is made to the same record, the access results are different between when the record belongs to the same global transaction and when the record belongs to a different global transaction. Tables 4-7 and 4-8 show the processing results when a function was called more than once for the same record.

Table 4-7 Processing results when function was called more than once for the same record (in one global transaction)

Previously called function Function to be called Results or error return value
No function for accessing a TAM table has been called in the transaction dc_tam_read (input for reference) Y
dc_tam_read (input for reference, lock specified) Y
dc_tam_read (input for update) Y
dc_tam_read_cancel (input cancellation) DCTAMER_SEQENCE (01732)
dc_tam_rewrite (update on the assumption of input) DCTAMER_SEQENCE (01732)
dc_tam_write (update) Y
dc_tam_write (addition) Y
dc_tam_delete (deletion) Y
dc_tam_read (input for reference) dc_tam_read (input for reference) Y
dc_tam_read (input for reference, lock specified) Y
dc_tam_read (input for update) Y
dc_tam_read_cancel (input cancellation) DCTAMER_SEQENCE (01732)
dc_tam_rewrite (update on the assumption of input) DCTAMER_SEQENCE (01732)
dc_tam_write (update) Y
dc_tam_write (addition) DCTAMER_EXKEY (01735)
dc_tam_delete (deletion) Y
dc_tam_read (input for reference, lock specified) dc_tam_read (input for reference) Y
dc_tam_read (input for reference, lock specified) Y
dc_tam_read (input for update) Y
dc_tam_read_cancel (input cancellation) Y#1
dc_tam_rewrite (update on the assumption of input) DCTAMER_SEQENCE (01732)
dc_tam_write (update) Y
dc_tam_write (addition) DCTAMER_EXKEY (01735)
dc_tam_delete (deletion) Y
dc_tam_read (input for update) dc_tam_read (input for reference) Y
dc_tam_read (input for reference, lock specified) Y
dc_tam_read (input for update) Y
dc_tam_read_cancel (input cancellation) Y
dc_tam_rewrite (update on the assumption of input) Y
dc_tam_write (update) Y
dc_tam_write (addition) DCTAMER_EXKEY (01735)
dc_tam_delete (deletion) Y
dc_tam_read_
cancel (input cancellation)
dc_tam_read (input for reference) Y
dc_tam_read (input for reference, lock specified) Y
dc_tam_read (input for update) Y
dc_tam_read_cancel (input cancellation) DCTAMER_SEQENCE (01732)#2
dc_tam_rewrite (update on the assumption of input) DCTAMER_SEQENCE (01732)
dc_tam_write (update) Y
dc_tam_write (addition) DCTAMER_EXKEY (01735)
dc_tam_delete (deletion) Y
dc_tam_rewrite (update on the assumption of input) dc_tam_read (input for reference) Y
dc_tam_read (input for reference, lock specified) Y
dc_tam_read (input for update) Y
dc_tam_read_cancel (input cancellation) DCTAMER_EXREWRT (01734)
dc_tam_rewrite (update on the assumption of input) Y
dc_tam_write (update) Y
dc_tam_write (addition) DCTAMER_EXKEY (01735)
dc_tam_delete (deletion) Y
dc_tam_write (update or addition) dc_tam_read (input for reference) Y
dc_tam_read (input for reference, lock specified) Y
dc_tam_read (input for update) Y
dc_tam_read_cancel (input cancellation) DCTAMER_SEQENCE (01732)
dc_tam_rewrite (update on the assumption of input) DCTAMER_SEQENCE (01732)
dc_tam_write (update) Y
dc_tam_write (addition) DCTAMER_EXKEY (01735)
dc_tam_delete (deletion) Y
dc_tam_delete (deletion) dc_tam_read (input for reference) DCTAMER_NOREC (01731)
dc_tam_read (input for reference, lock specified) DCTAMER_NOREC (01731)
dc_tam_read (input for update) DCTAMER_NOREC (01731)
dc_tam_read_cancel (input cancellation) DCTAMER_NOREC (01731)
dc_tam_rewrite (update on the assumption of input) DCTAMER_NOREC (01731)#3
dc_tam_write (update) DCTAMER_NOREC (01731)
dc_tam_write (addition) Y
dc_tam_delete (deletion) DCTAMER_NOREC (01731)

Legend:
Y: No error
DCTAMER_NOREC (01731): The specified record is not found.
DCTAMER_SEQENCE (01732): The function dc_tam_read() has not been called.
DCTAMER_EXREWRT (01734): The table descriptor was updated by the dc_tam_rewrite().
DCTAMER_EXKEY (01735): Addition is not permitted because there is the record of the key value specified in the function.

#1
DCTAMER_EXREWRT or DCTAMER_EXWRITE is returned in the following case:
Before the function dc_tam_read() (input for reference, lock specified) is called, the function dc_tam_rewrite() or the function dc_tam_write() has been called to update or add a record.

#2
DCTAMER_EXWRITE is returned in the following case:
Before the function dc_tam_read_cancel() (input cancellation) is called, the function dc_tam_rewrite() or the function dc_tam_write() has been called to update or add a record.

#3
DCTAMER_SEQENCE is returned in the following case:
Before the function dc_tam_delete() (deletion) is called, the function dc_tam_write() has been called to add a record.

Table 4-8 Processing results when function was called more than once for the same record (in a different global transaction)

Previously called function Function to be called Results or error return value
No function for accessing a TAM table has been called in the transaction. dc_tam_read (input for reference) Y
dc_tam_read (input for reference, lock specified) Y
dc_tam_read (input for update) Y
dc_tam_read_cancel (input cancellation) --#1
dc_tam_rewrite (update on the assumption of input) --#1
dc_tam_write (update) Y
dc_tam_write (addition) Y
dc_tam_delete (deletion) Y
dc_tam_read (input for reference) dc_tam_read (input for reference) Y
dc_tam_read (input for reference, lock specified) Y#2
dc_tam_read (input for update) Y#2
dc_tam_read_cancel (input cancellation) --#1
dc_tam_rewrite (update on the assumption of input) --#1
dc_tam_write (update) Y#2
dc_tam_write (addition) DCTAMER_EXKEY (01735)
dc_tam_delete (deletion) Y#2
dc_tam_read (input for reference, lock specified) dc_tam_read (input for reference) Y
dc_tam_read (input for reference, lock specified) Y#2
dc_tam_read (input for update) DCTAMER_LOCK (01736)#3
dc_tam_read_cancel (input cancellation) --#1
dc_tam_rewrite (update on the assumption of input) --#1
dc_tam_write (update) DCTAMER_LOCK (01736)#3
dc_tam_write (addition) DCTAMER_LOCK (01736)#3
dc_tam_delete (deletion) DCTAMER_LOCK (01736)#3
dc_tam_read (input for reference) dc_tam_read (input for reference) Y
dc_tam_read (input for reference, lock specified) DCTAMER_LOCK (01736)#3
dc_tam_read (input for update) DCTAMER_LOCK (01736)#3
dc_tam_read_cancel (input cancellation) --#1
dc_tam_rewrite (update on the assumption of input) --#1
dc_tam_write (update) DCTAMER_LOCK (01736)#3
dc_tam_write (addition) DCTAMER_LOCK (01736)#3
dc_tam_delete (deletion) DCTAMER_LOCK (01736)#3
dc_tam_read_cancel (input cancellation) dc_tam_read (input for reference) Y
dc_tam_read (input for reference, lock specified) Y#4, #5
dc_tam_read (input for update) Y#4, #5
dc_tam_read_cancel (input cancellation) --#1
dc_tam_rewrite (update on the assumption of input) --#1
dc_tam_write (update) Y#4, #5
dc_tam_write (addition) DCTAMER_LOCK (01736)#3
dc_tam_delete (deletion) DCTAMER_LOCK (01736)#3
dc_tam_rewrite (update on the assumption of input) dc_tam_read (input for reference) Y
dc_tam_read (input for reference, lock specified) DCTAMER_LOCK (01736)#3
dc_tam_read (input for update) DCTAMER_LOCK (01736)#3
dc_tam_read_cancel (input cancellation) --#1
dc_tam_rewrite (update on the assumption of input) --#1
dc_tam_write (update) DCTAMER_LOCK (01736)#3
dc_tam_write (addition) DCTAMER_LOCK (01736)#3
dc_tam_delete (deletion) DCTAMER_LOCK (01736)#3
dc_tam_write (update, or addition) dc_tam_read (input for reference) Y
dc_tam_read (input for reference, lock specified) DCTAMER_LOCK(01736)#3
dc_tam_read (input for update) DCTAMER_LOCK (01736)#3
dc_tam_read_cancel (input cancellation) --#1
dc_tam_rewrite (update on the assumption of input) --#1
dc_tam_write (update) DCTAMER_LOCK (01736)#3
dc_tam_write (addition) DCTAMER_LOCK (01736)#3
dc_tam_delete (deletion) DCTAMER_LOCK (01736)#3
dc_tam_delete (deletion) dc_tam_read (input for reference) Y
dc_tam_read (input for reference, lock specified) DCTAMER_LOCK (01736)#3
dc_tam_read (input for update) DCTAMER_LOCK (01736)#3
dc_tam_read_cancel (input cancellation) --#1
dc_tam_rewrite (update on the assumption of input) --#1
dc_tam_write (update) DCTAMER_LOCK (01736)#3
dc_tam_write (addition) DCTAMER_LOCK (01736)#3
dc_tam_delete (deletion) DCTAMER_LOCK (01736)#3

Legend:
Y: No error
--: Not applicable

DCTAMER_EXKEY (01735): Addition is not permitted because there is the record of the key value specified in the function.

DCTAMER_LOCK (01736): An lock error occurred.

#1: Another processing is executed in a different transaction.

#2: If another global transaction has added a record to or deleted a record from the same TAM table, DCTAMER_LOCK (01736) is returned. If DCTAM_WAIT is specified as the lock wait type, the wait-for release mode goes into effect.

#3: When DCTAM_WAIT is specified for the lock wait type, the function waits until the record is released from lock.

#4: DCTAMER_LOCK (01736) is returned if a record has been added to or deleted from the same TAM table in another transaction. However, when DCTAM_WAIT is specified for the lock wait type, the function waits until the record is released from lock.

#5: DCTAMER_LOCK (01736) is returned in the following case:
  • Before the function dc_tam_read_cancel() is called, the function dc_tam_rewrite() or the function dc_tam_write() has been called to update or add a record in another global transaction. However, when DCTAM_WAIT is specified for the lock wait type, the function waits until the record is released from lock.