Autonomous Transactions Flashcards

1
Q

A transaction starts when one of the following events take place -

A
  • The first SQL statement is performed after connecting to the database.
  • At each new SQL statement issued after a transaction is completed.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A transaction ends when one of the following events take place −

A
  • A COMMIT or a ROLLBACK statement is issued
  • A DDL or DCL statement is issued (Commit automatically performed)
  • The user disconnects from the database
  • A DML statement fails (Rollback automatically performed)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

A transaction is made permanent by issuing the SQL command ___

A

COMMIT;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Changes made to the database without COMMIT could be undone using the ___ command

A

ROLLBACK;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

___ are sort of markers that help in splitting a long transaction into smaller units by setting some checkpoints

A

Savepoints

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the general syntax for creating a save point and rolling back to said save point?

A

SAVEPOINT saveName;

ROLLBACK TO saveName;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are autonomous transactions?

A

Autonomous transactions are independent transactions that can be called from within another transaction

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What must autonomous transactions do before it returns control to the calling transaction?

A

commit or rollback

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

When do changes made by the autonomous transaction become visible to other transactions?

A

Upon commit of the autonomous transactions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Does the autonomous transaction see uncommitted changes made by the main transaction?

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How do you call an autonomous transaction from within a PL/SQL block?

A

PRAGMA AUTONOMOUS_TRANSACTION;

In the declare section

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What kind of PL/SQL blocks can you declare to be autonomous?

A
  • Stored procedure or function
  • Local procedure or function
  • Package
  • Type method
  • Top-level anonymous block
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are Pragmas?

A
  • A compiler directive
  • Processed at compile time, not at run time
  • Passes info to the compiler
How well did you know this?
1
Not at all
2
3
4
5
Perfectly