Oracle - Transactions

Transactioning is automatically turned on in oracle sql developer

What you did What you see What others see
Select count(*) from Names 50 records 50 records
Insert into names (id, name) values (1011, ‘mark’)
Select count(*) from Names 51 records 50 records

What happens is you are in a transaction. People do not see your stuff until you commit / rollback

What you did What you see What others see
Select count(*) from Names 51 records 50 records
Commit
Select count(*) from Names 51 records 51 records
Insert into names (id, name) values (1015, ‘mark’)
Select count(*) from Names 52 records 51 records
Rollback
Select count(*) from Names 51 records 51 records

Commit and rollback are required to lock in your work.

Sometimes there’s an Automatic Commit. These are what will cause an automatic commit

  • Truncate tables
  • DDL