Skip to content

Commit 26d70aa

Browse files
committed
Revert "Use loop for creating data with Hibernate Reactive"
This reverts commit 43db1d8.
1 parent 43db1d8 commit 26d70aa

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

  • frameworks/Java/quarkus/resteasy-reactive-hibernate-reactive/src/main/java/io/quarkus/benchmark/repository

frameworks/Java/quarkus/resteasy-reactive-hibernate-reactive/src/main/java/io/quarkus/benchmark/repository/WorldRepository.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@ public Uni<Void> createData() {
2424
return inSession(s -> {
2525
final LocalRandom random = Randomizer.current();
2626
int MAX = 10000;
27-
Uni<Void> loop = Uni.createFrom().voidItem();
27+
Uni<Void>[] unis = new Uni[MAX];
2828
for (int i = 0; i < MAX; i++) {
2929
final World world = new World();
3030
world.setId(i + 1);
3131
world.setRandomNumber(random.getNextRandom());
32-
loop = loop.call(() -> s.persist(world));
32+
unis[i] = s.persist(world).map(v -> null);
3333
}
34-
return loop.call(s::flush);
34+
return Uni.combine().all().unis(unis).with(l -> null)
35+
.flatMap(v -> s.flush())
36+
.map(v -> null);
3537
});
3638
}
3739

0 commit comments

Comments
 (0)