set lock_timeout 2000
Oracle 이라면 update/delete 문장 수행 전에 no wait, wait 옵션을 지정한 select ... for update 문을 먼저 수행해서 Lock 설정을 체크할 수 있다.
select * from t where no = 1 for update no wait : 대기없이 Exception을 던짐
select * from t where no = 1 for update wait 3 : 3초 대기 후 Exception을 던짐




[ 스키마 Lock 호환성 ]
|
| lock table emp in row share mode; lock table emp in row exclusive mode; lock table emp in share mode; lock table emp in share row exclusive mode; lock table emp in exclusive mode; |
