Format COMMIT
1 – Description
The COMMIT command ends a transaction and makes permanent any changes you made during that transaction. This command also releases all locks and closes all open streams. It affects all databases participating in the currently open transaction. See the START_TRANSACTION command description for restrictions that apply when using START_TRANSACTION . . . COMMIT stream of commands.
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. But, it is possible to use them 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 a CDO-E-NOTFOUND message, 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.