It's time to discuss the Atomicity of a database in little more detail. But before we begin, here is a disclaimer.
Disclaimer: this post has no relation whatsoever to this , this and this
Now, I mentioned in my previous post that the transaction on an atomic database follows "all or none" rule. So, here it means that a database transaction is either successful or failed.
There is no such thing as partial successful/failed transaction. If any part of transaction fails, the whole transaction fails. (See this to learn about a database transaction)
e.g. A there is database transaction consisting of three steps occurring serially (to move record from one table to other table).
In above example, if step 2 fails, the step 3 should not occur and step 1 should be undone (rolled-back). This transaction will be successful only if all the steps are successful.
In the nutshell, in an atomic database, either all statements or steps in a database transaction are successful or none.
Here is the Wikipedia link on the same topic.
Disclaimer: this post has no relation whatsoever to this , this and this
Now, I mentioned in my previous post that the transaction on an atomic database follows "all or none" rule. So, here it means that a database transaction is either successful or failed.
There is no such thing as partial successful/failed transaction. If any part of transaction fails, the whole transaction fails. (See this to learn about a database transaction)
e.g. A there is database transaction consisting of three steps occurring serially (to move record from one table to other table).
- Copy a row from one table to a other table
- Delete the same from first table
- Commit the changes on database.
In above example, if step 2 fails, the step 3 should not occur and step 1 should be undone (rolled-back). This transaction will be successful only if all the steps are successful.
In the nutshell, in an atomic database, either all statements or steps in a database transaction are successful or none.
Here is the Wikipedia link on the same topic.
No comments:
Post a Comment