Skip to content

Commit d27f7d7

Browse files
committed
when we're not using blocking, just go direct to the database
related to discussion around #707 This seems right for sequences. I'm not sure about tables though.
1 parent 42967a1 commit d27f7d7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

hibernate-reactive-core/src/main/java/org/hibernate/reactive/id/impl/BlockingIdentifierGenerator.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ protected synchronized long next(long hi) {
5454

5555
@Override
5656
public CompletionStage<Long> generate(ReactiveConnectionSupplier session, Object entity) {
57+
if ( getBlockSize()<=1 ) {
58+
//special case where we're not using blocking at all
59+
return nextHiValue(session);
60+
}
61+
5762
long local = next();
5863
if ( local >= 0 ) {
5964
// We don't need to update or initialize the hi

0 commit comments

Comments
 (0)