Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Santhosh Reddy.

Asked: November 16, 2016 - 1:37 am UTC

Last updated: November 16, 2016 - 5:58 am UTC

Version: 11g

Viewed 1000+ times

You Asked

Hi,
I would like to know about rollback and commit.do they commit or roll back the current session data or all the current session data on data base? For example a user inserted 10 rows and b user inserted 15 rows and b performed roll back then is it roll back the a user data?

and Connor said...

Each transaction on the database is independent of all others. So if I have a a connection, and you have a connection, then we can each commit and rollback without impacting each other.

Similarly, if I change some data (and have not yet committed), then you will not see the changes until I commit. Even further, if you start a query at 9am (that runs for 10mins), then if I change data at 9:02am *and* commit it, then even then, you will *still* not see the changed data in your query, because your query started at 9am, and thus sees a view of the data as it was at 9am.

Its one of the great things about relational databases.

It sounds like perhaps you are just getting started with databases, or Oracle. Have a read of the Concepts guide - it will be of great assistance

http://docs.oracle.com/database/121/CNCPT/toc.htm



Is this answer out of date? If it is, please let us know via a Comment