關於hibernate悲觀鎖設定方法setLockMode無效而setLockOptions有效的解答
阿新 • • 發佈:2019-01-24
Referring to the Session javadoc http://docs.jboss.org/hibernate/orm/4.2/javadocs/, LockMode parameter should be replaced with LockOptions.
Here is the excerpt from the javadoc.
@Deprecated Object load(String entityName, Serializable id, LockMode lockMode) Deprecated. LockMode parameter should be replaced with LockOptions
Parameters:
entityName - a persistent class
id - a valid identifier of an existing persistent instance of the class
lockMode - the lock level
Returns:
the persistent instance or proxy
I don't have a definite answer but for MySQL the only way to generate a
|
||
|
看來這個似乎是mysql的一個bug?搞不太明白。