> For the complete documentation index, see [llms.txt](https://flamme1004.gitbook.io/flamme-dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://flamme1004.gitbook.io/flamme-dev/info-1/database/db.md).

# DB락에 대해서 알아보기

\[lock]

nolock, shared(S) lock , exclusive(X) lock

\- select for update (mysql)

\- updlock (mssql)

\[isolation level]

read uncommitted :  no shared lock&#x20;

read committed: x lock when modify,  shared lock (read)&#x20;

&#x20; modified data 에 대해 읽을 수 없슴(commit 되기 전에는)

&#x20; 그러나 각 sql statement 간에 다른 transaction 이 write 할 수 있슴.

repeatable read: 각 sql statement 간에 다른 transaction 이 write 할 수 없슴

&#x20;               shared lock 읽은 모든 데이타에 대해 걸림. 따라서 다른 transaction 이 그 row를 변경 못함

serializable:  select shared lock, select 에 대해 영향을 받을 수 있는 모든 잠재적인 row 에 대한 insert/delete 못함

\[jpa]

pessimistic lock

proxy

![](https://15316191-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7_opr2RFh9Acog0_8H%2F-Ml5G3pBDjPjc3yl4Wd2%2F-Ml5G5bnzT5QZvcw_1Vi%2F%E1%84%89%E1%85%B3%E1%84%8F%E1%85%A6%E1%84%8E%E1%85%B5.png?alt=media\&token=cc073882-731a-4750-bf3c-f6f56789c585)
