mirror of https://github.com/apache/openjpa.git
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
This commit is contained in:
parent
1d889e3e50
commit
0022b991ab
|
@ -192,11 +192,15 @@ public class NativeJDBCSeq
|
||||||
protected synchronized Object nextInternal(JDBCStore store, ClassMapping mapping)
|
protected synchronized Object nextInternal(JDBCStore store, ClassMapping mapping)
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
if (_nextValue < _maxValue) {
|
if (_nextValue < _maxValue) {
|
||||||
return _nextValue++;
|
long result = _nextValue;
|
||||||
|
_nextValue += _increment;
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
allocateInternal(0, store, mapping);
|
allocateInternal(0, store, mapping);
|
||||||
return _nextValue++;
|
long result = _nextValue;
|
||||||
|
_nextValue += _increment;
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue