To implement reading and incrementing the counter, first perform a Read the counter at the same time, at least one of them ends up inĭeadlock when it attempts to update the counter. Here, LOCK IN SHARE MODE is not a good solution because if two users To add children with the same identifier to the table. It is not a good idea to use eitherĬonsistent read or a shared mode read to read the present value of theĬounter because two users of the database may then see the same valueįor the counter, and a duplicate-key error occurs if two users attempt Table child_codes that we use to assign a unique identifier to eachĬhild added to table child. Let us look at another example: We have an integer counter field in a I think the best way to handle this would be to use the SELECT.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |