From the course: Oracle Database 12c: Advanced SQL

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Transaction locks

Transaction locks - Oracle Database Tutorial

From the course: Oracle Database 12c: Advanced SQL

Start my 1-month free trial

Transaction locks

- [Instructor] Now it's time to see a demo of Oracle-based transaction locks. I'll be using the same sessions hr and hr2, which I've opened in the previous video. In this way, I have two separate and independent sessions connected to the database. It doesn't matter if they originate from the same user or from different users. So we will start by issuing another update to the employees table. Update employees set salary equals 30000 where employee id equals 100. So from the first session, the hr session, I have updated one row in my employees table. Now let's attempt to run another update from session number two. That is hr2, the second tab I have opened in my SQL Developer. So let's clear the Select command and paste our Update command. Let's say this session attempts to modify the employees table to a value of 35000. Let's run the select statement. And as you can see it is running. It is hanging. It is unable to modify the same row. That's because the first session has already…

Contents