How to lock a single row

后端 未结 5 496
长情又很酷
长情又很酷 2020-11-30 06:45

I have a user table with field lastusedecnumber.

I need to access and increment lastusedecnumber.

During that accessin

5条回答
  •  抹茶落季
    2020-11-30 07:10

    As a workaround you could add a column to your table, like locked TINYINT(1) - whenever you want the row to be locked you set it to 1. When you now try to access this row, the first thing you do is check if the locked fields is set.

    To unlock the row, simply set it to 0 again. Not nice but a really simple workaround.

提交回复
热议问题