File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
hibernate-core/src/main/java/org/hibernate/id/enhanced Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -235,16 +235,21 @@ public final int getIncrementSize() {
235
235
/**
236
236
* An optimizer that performs no optimization. The database is hit for
237
237
* every request.
238
+ *
239
+ * @deprecated This is the fallback Optimizer chosen when we fail to instantiate one
240
+ * of the proper implementations. Using this implementation is probably a performance
241
+ * problem.
238
242
*/
239
- public static class NoopOptimizer extends OptimizerSupport {
240
- private IntegralDataTypeHolder lastSourceValue ;
243
+ @ Deprecated
244
+ public static final class NoopOptimizer extends OptimizerSupport {
245
+ private volatile IntegralDataTypeHolder lastSourceValue ;
241
246
242
247
public NoopOptimizer (Class returnClass , int incrementSize ) {
243
248
super ( returnClass , incrementSize );
244
249
}
245
250
246
251
@ Override
247
- public Serializable generate (AccessCallback callback ) {
252
+ public synchronized Serializable generate (AccessCallback callback ) {
248
253
// IMPL NOTE : it is incredibly important that the method-local variable be used here to
249
254
// avoid concurrency issues.
250
255
IntegralDataTypeHolder value = null ;
You can’t perform that action at this time.
0 commit comments