1

We have recently started upgrading spring webflux version 2.7X to 3.3.2. After this upgrade, when we hit API with Postman it goes to controller layer and if service layer method is annotated with @Transactional, it does not reach to service layer. Further we got Error: socket hang up

But none of this found to be working. We found this question as well from where only we tried #1. Please suggest what could be wrong here.

We tried to debug by enabling org.springframework.transaction level to DEBUG but no luck Further, to solve the issue, we have tried:

  1. JTA @Transactional from "jakarta.transaction.Transactional" [latest version 2.0.1]
  2. transactionalOperator from "org.springframework.transaction.reactive.TransactionalOperator"
  3. Creating bean of transactionManager from "org.springframework.r2dbc.connection.R2dbcTransactionManager".
asked Oct 25, 2024 at 10:00
3
  • Maybe helps: Reactive Transactions with Spring. Reactive stack limits you and you don't have the use case for it. Commented Oct 25, 2024 at 13:05
  • Please provide enough code so others can better understand or reproduce the problem. Commented Oct 28, 2024 at 23:10
  • Can you please post controller and service classes code, so that is shown how the service is annotated and injected into the controller? I tried to reproduce your issue but transactions were opened and closed correctly. Anyway, try also to set org.springframework.transaction level to TRACE, because DEBUG may be not enough. Commented Oct 31, 2024 at 7:42

1 Answer 1

1

We have two dependencies in our POM file.

 <dependency>
 <groupId>io.r2dbc</groupId>
 <artifactId>r2dbc-postgresql</artifactId>
 <version>0.8.12.RELEASE</version>
 <scope>runtime</scope>
 </dependency>
 <dependency>
 <groupId>org.postgresql</groupId>
 <artifactId>r2dbc-postgresql</artifactId>
 <version>1.0.0.RELEASE</version>
 </dependency>

then We removed "io.r2dbc" dependency and it worked. But could not understand why it was working before upgrading version.

answered Nov 5, 2024 at 6:09
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.