PacktPublishing / Hands-On-Reactive-Programming-in-Spring-5

Hands-On Reactive Programming in Spring 5, published by Packt
MIT License
321 stars 207 forks source link

JPA becoming reactive and Hibernate Session #19

Closed afelguera closed 4 years ago

afelguera commented 4 years ago

Hi Tomasz,

I have a problem with Lazy relations in the Rx JPA Adapter. When using it, a LazyLoadingException arise because the session is no longer available when doing the getText() operations, such as in the following code:

@Override
public Flux<CountryDto> list() {
    return repository.findAll().map(e -> mapper.entityToDto(e, e.getText().orElse(new CountryText()))).log();
}

Method signature in the interface is @Transactional.

Thank you very much in advance.

Best regards, Toni Felguera

OlegDokuka commented 4 years ago

Hi @afelguera!

First of all, there is no Tomasz among the authors and maintainers. Please check if this is the right repo to ask the question.

Secondly, if you have any questions related to Hibernate / JPA - it is better to ask at the appropriate repository.