HHH-18377 Fixed bug with sequence resetting
This commit is contained in:
parent
69f8b9af2d
commit
d8dd5e7c0d
|
@ -98,9 +98,9 @@ public class UuidVersion6Strategy implements UUIDGenerationStrategy, UuidValueGe
|
|||
private long getSequence(final long currentTimestamp) {
|
||||
lock.lock();
|
||||
try {
|
||||
if ( this.currentTimestamp > currentTimestamp ) {
|
||||
if ( this.currentTimestamp < currentTimestamp ) {
|
||||
this.currentTimestamp = currentTimestamp;
|
||||
clockSequence.set( 0 );
|
||||
clockSequence.updateAndGet( l -> l & 0x1FFFL );
|
||||
}
|
||||
}
|
||||
finally {
|
||||
|
|
Loading…
Reference in New Issue