Pessimistic Lock yog qhov uas koj xav tias txhua tus neeg siv tab tom sim nkag mus rau tib cov ntaub ntawv thiab nws kaw cov ntaub ntawv tshwj xeeb rau thawj zaug pib ua lag luam kom txog thaum nws ua tiav tiav lossis ua tsis tiav. … Qhov no yuav kaw qhov khoom kom txog thaum them nyiaj tiav lossis ua tsis tiav.
Lub xauv qhov muag yog dab tsi?
Kev tswj hwm qhov tsis txaus ntseeg (lossis kev ntsuas qhov tsis zoo) yog hu ua "pessimistic" vim tias lub kaw lus xav tias qhov phem tshaj - nws xav tias ob lossis ntau tus neeg siv yuav xav hloov kho cov ntaub ntawv tib lub sijhawm, thiab ces tiv thaiv tau qhov no los ntawm kev kaw cov ntaub ntawv, txawm li cas los xij qhov tsis sib haum xeeb tiag tiag.
Dab tsi txawv ntawm kev cia siab thiab kev xav tsis zoo?
Kev ntsuas qhov zoo yog siv thaum koj tsis xav tias yuav muaj kev sib tsoo ntau. Nws raug nqi tsawg dua los ua haujlwm ib txwm muaj tab sis yog tias kev sib tsoo DOES tshwm sim koj yuav them tus nqi siab dua los daws nws vim tias qhov kev sib pauv tau rho tawm. Pessimistic locking yog siv thaum muaj kev sib tsoo.
Yuav ua li cas txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau txhawm rau hibernate?
Nyob rau hauv pessimistic xauv, cov khoom raug kaw thaum nws pib nkag mus rau thawj zaug hauv kev muab pauv. … Nyob rau hauv optimistic locking, cov khoom yog tsis xauv thaum nws nkag rau thawj zaug nyob rau hauv kev sib pauv. Hloov chaw, nws lub xeev (feem ntau yog tus lej version) tau txais kev cawmdim.
Yoghom kaw kaw tseem hu ua pessimistic locking?
4.3 Pessimistic Locking. Pessimistic locking yog qee zaum hu ua cov ntaub ntawv kaw. Koj tuaj yeem siv qhov ntsuas pim tsis zoo rau tiv thaiv ntau tus neeg siv lossis daim ntawv thov los ntawmhloov kho cov ntaub ntawv tib lub sijhawm. Piv txwv li, xav tias tus neeg siv nkag mus rau qhov kev sib pauv uas siv Cov Naj Npawb Tom ntej.