-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hibernate reactive panache refactoring
- do not store the current reactive session in the CDI request context but instead in the vertx duplicated context - do not offload execution of a panache entity method on the current vertx context but instead validate that the method is executed on the vedtx duplicated context - introduce ReactiveSessionInterceptor - ReactiveTransactionalInterceptor can only be used for method that return Uni; this is validated at build time - if resteasy-reactive is present then automatically associate the ReactiveSessionInterceptor with resource methods on classes that use a panache entity - also remove the quarkus-integration-test-hibernate-reactive-panache-blocking module
- Loading branch information
Showing
24 changed files
with
801 additions
and
791 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...n/runtime/src/main/java/io/quarkus/hibernate/reactive/panache/common/ReactiveSession.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package io.quarkus.hibernate.reactive.panache.common; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Inherited; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
import javax.interceptor.InterceptorBinding; | ||
|
||
import org.hibernate.reactive.mutiny.Mutiny; | ||
|
||
import io.smallrye.mutiny.Uni; | ||
|
||
/** | ||
* Instructs Panache to invoke the intercepted method within a scope of a reactive {@link Mutiny.Session}. | ||
* <p> | ||
* An existing reactive {@link Mutiny.Session} is reused. If no session exists then a new session is opened lazily and | ||
* eventually closed when the {@link Uni} returned from the annotated method completes. | ||
* <p> | ||
* A method annotated with this annotation must return {@link Uni}. If declared on a class then all methods that are intercepted | ||
* must return {@link Uni}. | ||
*/ | ||
@Inherited | ||
@InterceptorBinding | ||
@Target({ ElementType.TYPE, ElementType.METHOD }) | ||
@Retention(value = RetentionPolicy.RUNTIME) | ||
public @interface ReactiveSession { | ||
|
||
} |
Oops, something went wrong.