HHH-3001 - The NoopOptimizer is not thread safe
git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@19994 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
48a5e04caa
commit
7f815de1a7
|
@ -187,15 +187,14 @@ public class OptimizerFactory {
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
public Serializable generate(AccessCallback callback) {
|
public Serializable generate(AccessCallback callback) {
|
||||||
if ( lastSourceValue == null ) {
|
// IMPL NOTE : it is incredibly important that the method-local variable be used here to
|
||||||
do {
|
// avoid concurrency issues.
|
||||||
lastSourceValue = callback.getNextValue();
|
IntegralDataTypeHolder value = null;
|
||||||
} while ( lastSourceValue.lt( 1 ) );
|
while ( value == null || value.lt( 1 ) ) {
|
||||||
|
value = callback.getNextValue();
|
||||||
}
|
}
|
||||||
else {
|
lastSourceValue = value;
|
||||||
lastSourceValue = callback.getNextValue();
|
return value.makeValue();
|
||||||
}
|
|
||||||
return lastSourceValue.makeValue();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue