[英]What does “lock” boolean mean in GenericHibernateDAO's method findById?
I am using hibernate. 我正在使用休眠模式。 When i have to find a specific entity, i want to use the findById(Long id, boolean lock)
当我必须找到特定实体时,我想使用findById(Long id,boolean lock)
method. 方法。 What value should i give to lock?
我应该给锁赋予什么价值?
There are several overloaded findById. 有几个重载的findById。 You should choose one depending on the locking strategy you are using.
您应根据所使用的锁定策略选择一种。
I suggest read about optimist and pessimist locking. 我建议阅读有关乐观主义者和悲观主义者锁定的文章。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.