openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtyle...@apache.org
Subject svn commit: r1078811 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/NativeJDBCSeq.java
Date Mon, 07 Mar 2011 15:30:26 GMT
Author: mtylenda
Date: Mon Mar  7 15:30:25 2011
New Revision: 1078811

URL: http://svn.apache.org/viewvc?rev=1078811&view=rev
Log:
OPENJPA-1376: Correctly handle the case when sequence increment is > 1.

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/NativeJDBCSeq.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/NativeJDBCSeq.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/NativeJDBCSeq.java?rev=1078811&r1=1078810&r2=1078811&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/NativeJDBCSeq.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/NativeJDBCSeq.java
Mon Mar  7 15:30:25 2011
@@ -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;
     }
 
     /**



Mime
View raw message