You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unsure whether or not this is a bug or expected behaviour. When annotating a suspending kotlin function with both @PreAuthorize and @Transactional
and not returing a Mono/Flux/Flow the PrePostAdviceReactiveMethodInterceptor does not proceed to invoke the transaction interceptor. It is possible to work around this issue by for example moving the @Transactional annotation to the RestController
To Reproduce
@Service
class Dummy(private val repository: FooRepository) {
@PreAuthorize("hasAnyAuthority('FOO', 'BAR')")
@Transactional
suspend fun foo(name: String): FooDto {
val rowsUpdated = repository.insertSomethingSuspended()
return FooDto(name)
}
data class FooDto(val name: String)
}
Expected behavior
I would expect the PrePostAdviceReactiveMethodInterceptor to proceed to the next interceptor in the chain