如何@Lock为查询指定超时.我正在使用oracle 11g,我希望我可以使用类似的东西'select id from table where id = ?1 for update wait 5'.
我定义了这样的方法,
@Lock(LockModeType.PESSIMISTIC_WRITE)
Stock findById(String id);
Run Code Online (Sandbox Code Playgroud)
它似乎永远锁定.我开始javax.persistence.lock.timeout=0了LocalContainerEntityManagerFactoryBean.jpaProperties,但没有受到影响.