tags:

views:

25

answers:

1

Hi,

I am trying to understand the ACID property of database transction: how they are achieved; which part is atomicity and which part is durability ,etc.

Let's say I have a transction with two actions,A and B. Unfortunately, system powered off when performing action B. After a system reset, we know the database will preserve (through the rollback jounery in sqlite) the state before performing action A. So, which ACID property does this show, atomicity or durability?

Another case :Suppose when performing action B , an error happened and was notified to the applicaiton , and the application rollback. I consider this is as pure atomicity which is achieved by the user but not by the database engine. Am I correct?

A: 

Both examples highlight atomicity: either both A and B are committed, or neither.

Durability is a property that comes into the picture only after the transaction is committed. The application can rest assured that if the COMMIT call succeeded, then is durable. A system reset or a power off will not revert the effect of a committed transaction, hence its durability.

Remus Rusanu