Skip to main content

Locked row without error: A bug or a feature?

  • September 10, 2019
  • 26 replies
  • 7 views

Show first post

26 replies

Ingo Stiller
Forum|alt.badge.img+3
  • Author
  • Participating Frequently
  • September 30, 2019

Hi Gianni

Ever do account software? 🙂
Lets have the following szenario:

One desk offizier starts a transaction about acount side transfer of money.
But he did not commit
Now he starts a second session and start the credit transfer to his bank account
The proper account record is aval (locked but avail)
After the transfer to the bank is done, he rollback the first session.

Nobody see the account record wich lead to the credit transfer


Another szenario
One clerk creates mass of account records by a weekly run. This run is still ongoing without a commit.
Another clerk runs a report against the database.
Wow we got thousend of euros at the end of the week, I have to report my boss.
But then there went something wrong at the first session and the bookings will be rolled back.

How's to blame ... 🙂

Ingo






Hi Gianni

Yes, I already got an email about this entry.
The workarounds are "nice"

a) Set the database to "snapshot isolation": Much to heavy for simple reads

b) Set MLW greater then "locktime":
   A real lock should only last for a second, a long runnig script could take a "few" seconds.
   So it's not a good idea to set MLW to more then 2 seconds

Ingo