Format
ROLLBACK
1 – Description
The ROLLBACK command terminates a transaction and undoes all
changes that have been made to the database since the program's
most recent START_TRANSACTION command. The ROLLBACK command also
releases all locks, closes all open streams, and releases all
readied relations. It affects all databases participating in
the currently open transaction. The ROLLBACK command implicitly
performs the END_STREAM statement.
2 – Restrictions
o When you delete a record, local fields within that record are
marked for deletion at the end of the transaction, provided
that they remain unused at the end of the transaction. Using
CDO, there is no way to reuse those local fields. It is
possible to use local fields through the Oracle CDD/Repository
APIs. Therefore, the local fields cannot be automatically
deleted at the same point in the transaction as the record.
You must either delete the record and field in separate
transactions (outside the START_TRANSACTION . . . COMMIT stream
of commands) or, to accomplish this in one transaction, use
the ENTER command to enter the local field, delete the record,
delete the local field, and then delete the global field.
o Usually, if Oracle CDD/Repository issues any errors between
the START_TRANSACTION and COMMIT commands, it forces you
to roll back the transaction. In some cases, such as in the
CHANGE or DELETE commands, Oracle CDD/Repository allows you to
commit the transaction. The general rules are:
- If you receive an Oracle CDD/Repository error of E or F
severity, such as a CDD-E-NODNOTFND message, you must abort
the transaction.
- If you receive a CDO error of E or F severity, such as
CDO-E-NOTFOUND, you can continue to operate in the current
transaction.
3 – Examples
CDO> START_TRANSACTION
CDO> DEFINE RECORD REC2.
cont> FLD1. END RECORD.
.
.
.
CDO> SHOW RECORD REC2
Definition of record REC2 | Contains field FLD1
CDO> ROLLBACK
CDO> SHOW RECORD REC2
%CDO-E-ERRSHOW, error displaying an object
-CDO-E-NOTFOUND, entity REC2 not found in dictionary
In this example, a record is defined within a transaction,
but because the transaction is terminated using the ROLLBACK
command, the record is not defined.