HHH-5929 PooledLoOptimizer is not thread-safe
All Optimizers in OptimizerFactory are thread safe by having the #generate(AccessCallback) method synchronized. The only exception is PooledLoOptimizer who's #generate(AccessCallback) method is not synchronized. - make PooledLoOptimizer#generate(AccessCallback) synchronized https://hibernate.onjira.com/browse/HHH-5929 https://hibernate.onjira.com/browse/HHH-6829
This commit is contained in:
parent
a86997c7ba
commit
3e4786220c
|
@ -514,7 +514,7 @@ public class OptimizerFactory {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Serializable generate(AccessCallback callback) {
|
||||
public synchronized Serializable generate(AccessCallback callback) {
|
||||
if ( lastSourceValue == null || ! value.lt( lastSourceValue.copy().add( incrementSize ) ) ) {
|
||||
lastSourceValue = callback.getNextValue();
|
||||
value = lastSourceValue.copy();
|
||||
|
|
Loading…
Reference in New Issue