Annotation Interface WithSession


@Inherited @InterceptorBinding @Target({TYPE,METHOD}) @Retention(RUNTIME) public @interface WithSession
Instructs Panache to perform the work represented by the Uni returned from the intercepted method within a scope of a reactive Mutiny.Session.

If a reactive session exists when the Uni returned from the annotated method is triggered, then this session is reused. Otherwise, a new session is opened and eventually closed when the Uni completes.

A method annotated with this annotation must return Uni. If declared on a class then all methods that return Uni are considered; all other methods are ignored.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Requests a stateless session, as opposed to a managed session.
    The name of the persistence unit.
  • Element Details

    • value

      String value
      The name of the persistence unit. If not specified, the default persistence unit is used.
      Returns:
      the persistence unit name
      Default:
      "<default>"
    • stateless

      boolean stateless
      Requests a stateless session, as opposed to a managed session.
      Default:
      false