mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-03-07 18:29:29 +00:00
HHH-18377 Fixed bug with sequence resetting
This commit is contained in:
parent
69f8b9af2d
commit
d8dd5e7c0d
@ -98,9 +98,9 @@ public UUID generateUuid(SharedSessionContractImplementor session) {
|
|||||||
private long getSequence(final long currentTimestamp) {
|
private long getSequence(final long currentTimestamp) {
|
||||||
lock.lock();
|
lock.lock();
|
||||||
try {
|
try {
|
||||||
if ( this.currentTimestamp > currentTimestamp ) {
|
if ( this.currentTimestamp < currentTimestamp ) {
|
||||||
this.currentTimestamp = currentTimestamp;
|
this.currentTimestamp = currentTimestamp;
|
||||||
clockSequence.set( 0 );
|
clockSequence.updateAndGet( l -> l & 0x1FFFL );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user