Skip to content

@ReactiveTransactional support Kotlin suspend function  #25563

@RyanWang0811

Description

@RyanWang0811

Description

I use quarkus with kotlin suspend function to write the reactive programming.

When I try to use quarkus-hibernate-reactive-panache and make the method in a transaction boundary by using @ReactiveTransactional like this

  @POST
  @Path("/suspend/withReactiveTransactionalAnnotation")
  @ReactiveTransactional
  suspend fun createFruitSuspendWithReactiveTransactionalAnnotation(fruitRequestDTO: FruitRequestDTO): FruitPO? {
      return fruitService.createFruitSuspendWithReactiveTransactionalAnnotation(fruitRequestDTO)
  }

https://github.com/aotter/quarkus-examples/blob/8f4292c7ac0f4a2af70836d7bcbc28f04902b6e4/hibernate-reactive-panache-quickstart-kotlin/src/main/kotlin/net/aotter/FruitResource.kt#L56-L61

I got the exception

only Uni is supported when using @ReactiveTransaction if you are running on a VertxThread

Is it possible to let the @ReactiveTransactional support kotlin suspend function?

Implementation ideas

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions