- All of the changes made to data during a transaction will be permanently stored in database
- Cha开发者_Go百科nges made to data during the transaction are not visible to other process until the transaction completes
- Integrity constraints are satisfied once transaction completes
- While one process is modifying some data with in a transaction,a second process must wait untill the first completes its transaction
4 is not guaranteed
While in a transaction to modify certain tables, other processes can modify the same tables using their transactions.
EDIT:
I believe other processes will indeed have to wait to update the same tables used by the first process' transaction. Other processes will be allowed to carry out their transactions concurrently as long as they involve other tables (not the tables updated in the first process' transaction). So I would still say option 4 is not guaranteed, because option 4 is too broad.
1 - If it fails half way through, the data changes will be rolled back. Note about #4...The process in the transaction can have a lock on one or a few tables, but that doesn't mean the whole database most of the time. Other processes can hit the tables that aren't locked.
These options are a little broad for my taste, particularly when asking about guarantees. There are problems with several of them:
- Item 1 is guaranteed for committed transactions, not ones that are rolled back.
- Item 2 can be defeated depending on the DBMS (like SQL Server's
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
), but I suspect this one is valid from a textbook's standpoint. - I will grant that #3 is valid if we don't nitpick things like the ability to disable constraints, though you can argue that the data satisfies general integrity requirements because it satisfies any in-force constraints.
- Item 4 is not guaranteed for the reasons given by @byneri and @DaMartyr - unrelated data can still be modified.
If I had to pick one it would be #4, but #1 is tempting as well. It's tough to know what a professor/textbook is looking for after you've in the real world for a number of years.
精彩评论