Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
|
This is the result of the transaction isolation.
The update is done in a session, into a transaction.
The moment the update is done is not the same the commit is done into the db.
So, the same client can see the updated value right after, because that it uses the same session than on the update, even before the update is commited to disk.
See the session like a sheet of paper, where you write things to do before putting them in your agenda. Peoples looking at the agenda won't see what you have noted on the sheet, but you have wrote it.
It's just not available to everyone who can access your agenda...
As the second client is into another session, and the transaction has not been commited to disk, it doesn't see the modification.
As saurabhj said, locking every client until each transaction is commited would introduce too much wait time.
You have to design your application with that in mind.
__________________
Only a biker knows why a dog sticks his head out the window.
|