mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-17 00:24:57 +00:00
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 PooledLoOptimizer(Class returnClass, int incrementSize) {
|
||||
}
|
||||
|
||||
@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…
x
Reference in New Issue
Block a user