tags:

views:

51

answers:

2

Rollback is used to reach the previous commit, but what will it do exactly?

+1  A: 

No, it rollbacks to the previous/specified transaction start (or savepoint). Incidentally, it can correspond to the last commit.

Note that those terms can vary slightly depending on the RDBMS/Language.

streetpc
A: 

Well, the details obviously depend somewhat on the DBMS you use.

But in principle, yes, rollback will return you to the state just before you started the transaction you are currently in.

The details are things like how e.g. data dictionary changes are handled. Also, some systems allow nested or distributed transactions, then things get more hairy.

Details on Wikipedia, as usual :-).

sleske

related questions