Library /sys$common/syshlp/CDO$HELP.HLB  —  CDO Commands, START_TRANSACTION
    Format

      START_TRANSACTION

1  –  Description

    The START_TRANSACTION command initiates a group of commands that
    Oracle CDD/Repository executes as a unit. A transaction ends
    with a COMMIT or ROLLBACK command. The COMMIT command causes
    all commands to execute, while the ROLLBACK command causes no
    commands to execute.

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
       ENTER 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> COMMIT
  CDO> SHOW RECORD REC2
  Definition of record REC2
  |   Contains field           FLD1
     .
     .
     .

      In this example, the COMMIT command ends a session started
      with the START_TRANSACTION command. When you use the START_
      TRANSACTION and COMMIT commands, the overhead that is
      associated with these commands is incurred once in the
      repository and once in the database, rather than once for each
      CDO command between the START_TRANSACTION and COMMIT commands.
      The repository is already attached to the database and has
      already loaded the type definitions. The objects REC2 and FLD1
      are retrieved from memory instead of from disk.
Close Help