tags:

views:

46

answers:

2

Is there any way to see only committed data only in the same session. Like User A updated table with 10 rows and committed. then again updated 20 rows but not committed, so here User A should only see committed data (10 Updated rows)

A: 

Yep,

You want to use a save point.

A better link on save points

Save point link

A save point will allow you to save after a part of a transaction is complete. Then if the second part is rolled back you will keep your changes before the save point and lose the ones after the save point.

Leigh Shayler
Sorry, I think i missed the point about being within the same session.
Leigh Shayler
+2  A: 

You might want to (ab)use an autonomous transaction to accomplish this. Just run the query in a function with PRAGMA AUTONOMOUS_TRANSACTION and it will only see commited data.

ammoQ
+1. That's a good suggestion.
Guru