Applications always Explicitly commit or roll back transactions before program termination

Q.  Applications should always _____________ commit or roll back transactions before program termination.

- Published on 19 Oct 15

a. Implicitly
b. Explicitly
c. Either of a and b
d. None of the above

ANSWER: Explicitly
 

    Discussion

  • Nirja Shah   -Posted on 01 Oct 15
    - A transaction in Oracle begins when the first executable SQL statement is encountered.

    - An executable SQL statement is a SQL statement that generates calls to an instance, including DML and DDL statements.

    - When a transaction begins, Oracle assigns the transaction to an available undo tablespace to record the rollback entries for the new transaction.

    - A transaction ends when any of the following occurs:

    1. A user issues a COMMIT or ROLLBACK statement without a SAVEPOINT clause.

    2. A user runs a DDL statement such as CREATE, DROP, RENAME, or ALTER.
    - If the current transaction contains any DML statements, Oracle first commits the transaction, and then runs and commits the DDL statement as a new, single statement transaction.

    3. A user disconnects from Oracle. The current transaction is committed.

    4. A user process terminates abnormally. The current transaction is rolled back.

    - After one transaction ends, the next executable SQL statement automatically starts the following transaction.

    - Applications should always explicitly commit or undo transactions before program termination.

Post your comment / Share knowledge


Enter the code shown above:
 
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)