database transactions Flashcards

(27 cards)

1
Q

database transaction

A

any (possibly multi-step) action that reads from and/or writes to a database

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

a database transaction may consist of

A

a single SQL statement or a collection of related SQL statements

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

successful transaction

A

all of the SQL statements are completed successfully

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

consistent database state

A

all data integrity constraints are satisfied

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

successful transaction changes the database from

A

one consistent state to another

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

improper or incomplete transactions can have a

A

devastating effect on database integrity

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

if a DBMS supports transaction management, it will

A

roll back an inconsistent database to a previous consistent state

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

an inconsistent database is the result of

A

an unsuccessful transaction

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

properties of a transaction

A

atomicity
consistency
isolation
durability

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

atomicity

A

the “all or nothing” property
- all transaction operations must be completed
- transaction is treated as a single unit of work

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

consistency

A

when a transaction is completed, the database must be in a consistent state

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

isolation

A

data used during the execution of a transaction cannot be used by a second transaction until the first one is completed

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

durability

A

once transaction changes are committed (applied to database), they cannot be undone or lost due to a subsequent failure

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

if a transaction involves reading from a table,

A

no changes are made to the database, and it remains in a consistent state

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

if a transaction requires updating two tables, the database is in ____ only if _____

A

a consistent state, both database requests are successfully completed

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

ANSI SQL standards for managing transactions:

A

COMMIT;
ROLLBACK;
BEGIN TRANSACTION also used by some DBMSs

17
Q

COMMIT;

A

permanently records all changes in the database, automatically ends transaction

18
Q

ROLLBACK;

A

aborts all uncommitted changes, database is rolled back to previous state

19
Q

t/f: a rolled back transaction can typically be restarted later

20
Q

a DBMS maintains a transaction log to

A

support recovery to a consistent state

21
Q

transaction log stores

A
  • a record for the beginning of the transaction
  • a record for each transaction component
  • a record for the end of the transaction (COMMIT)
22
Q

the transaction log record for a transaction component includes

A
  • type of operation
  • tables/attributes affected
  • before and after values for attributes affected
23
Q

transaction log is typically implemented as

A

one or more files that are stored separately from the database itself

24
Q

t/f: a transaction log is automatically updated when the DBMS executes transactions

25
transaction log tradeoffs
increases DBMS processing overhead, but provides ability to restore a corrupted databased
26
MS Access only supports multi-step transactions when
using code to access DBMS - the SQL window within Access only allows one SQL statement to be run at a time
27
you can implement multi-step transactions in MS Access when
- connecting from other office applications via VBA - connecting from a .NET application - connecting from a web-based application, etc