Select for update skip locked from JPA level

前端 未结 3 1511
心在旅途
心在旅途 2021-02-19 06:42

In my application - Oracle with JPA (EclipseLink), I\'m using the following expression to lock the subset of the records in some tables:

select * from MY_TABLE w         


        
3条回答
  •  孤城傲影
    2021-02-19 06:54

    Oracle doesn't provide a read lock, since it doesn't need one; undo logs make it unnecessary. So, SELECT...FOR UPDATE is really just a WRITE lock for Oracle.

    Using JPA, you want to set the LockModeType as a PESSIMISTIC_WRITE.

提交回复
热议问题