From 0022b991ab84c0425663eb6475c6c2c75dcae0f2 Mon Sep 17 00:00:00 2001 From: Milosz Tylenda Date: Mon, 7 Mar 2011 15:30:25 +0000 Subject: [PATCH] OPENJPA-1376: Correctly handle the case when sequence increment is > 1. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1078811 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/openjpa/jdbc/kernel/NativeJDBCSeq.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/NativeJDBCSeq.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/NativeJDBCSeq.java index 069272c31..955b7f1e5 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/NativeJDBCSeq.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/NativeJDBCSeq.java @@ -192,11 +192,15 @@ public class NativeJDBCSeq protected synchronized Object nextInternal(JDBCStore store, ClassMapping mapping) throws SQLException { if (_nextValue < _maxValue) { - return _nextValue++; + long result = _nextValue; + _nextValue += _increment; + return result; } allocateInternal(0, store, mapping); - return _nextValue++; + long result = _nextValue; + _nextValue += _increment; + return result; } /**