From 40fbb3d31e015b63dcb01eb0d66a6365e9de1e68 Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Fri, 2 Nov 2007 16:18:14 +0000 Subject: [PATCH] HHH-2928 : synchronize enhanced id gen optimizers git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@14183 1b8cb986-b30d-0410-93ca-fae66ebed9b2 --- .../main/java/org/hibernate/id/enhanced/OptimizerFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/hibernate/id/enhanced/OptimizerFactory.java b/core/src/main/java/org/hibernate/id/enhanced/OptimizerFactory.java index 9ee126b915..018ac36056 100644 --- a/core/src/main/java/org/hibernate/id/enhanced/OptimizerFactory.java +++ b/core/src/main/java/org/hibernate/id/enhanced/OptimizerFactory.java @@ -120,7 +120,7 @@ public class OptimizerFactory { } } - public Serializable generate(AccessCallback callback) { + public synchronized Serializable generate(AccessCallback callback) { if ( lastSourceValue < 0 ) { lastSourceValue = callback.getNextValue(); while ( lastSourceValue <= 0 ) { @@ -168,7 +168,7 @@ public class OptimizerFactory { } } - public Serializable generate(AccessCallback callback) { + public synchronized Serializable generate(AccessCallback callback) { if ( hiValue < 0 ) { value = callback.getNextValue(); if ( value < 1 ) {