Skip to content

Commit f43a43a

Browse files
committed
Revert "[hibernate#1001] Don't create a new Vert.x instance if one exists"
This reverts commit 21ddc12.
1 parent 30a4582 commit f43a43a

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

hibernate-reactive-core/src/main/java/org/hibernate/reactive/vertx/impl/DefaultVertxInstance.java

+2-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import java.lang.invoke.MethodHandles;
99

10-
import io.vertx.core.Context;
1110
import io.vertx.core.Vertx;
1211

1312
import org.hibernate.reactive.logging.impl.Log;
@@ -30,7 +29,6 @@ public final class DefaultVertxInstance implements VertxInstance, Stoppable, Sta
3029
private static final Log LOG = LoggerFactory.make( Log.class, MethodHandles.lookup() );
3130

3231
private Vertx vertx;
33-
private boolean vertxCreator;
3432

3533
@Override
3634
public Vertx getVertx() {
@@ -42,18 +40,14 @@ public Vertx getVertx() {
4240

4341
@Override
4442
public void stop() {
45-
if ( vertxCreator && vertx != null ) {
43+
if ( vertx != null ) {
4644
vertx.close().toCompletionStage().toCompletableFuture().join();
4745
}
4846
}
4947

5048
@Override
5149
public void start() {
52-
final Context context = Vertx.currentContext();
53-
vertxCreator = context == null || context.owner() == null;
54-
vertx = vertxCreator
55-
? Vertx.vertx() // Create a new one
56-
: context.owner(); // Get the existing one
50+
vertx = Vertx.vertx();
5751
}
5852

5953
}

0 commit comments

Comments
 (0)