Home > Mobile >  Spring JPA JDBC in same transaction
Spring JPA JDBC in same transaction

Time:07-19

If a transaction is started using Spring's @Transactional, is there any issue using a combination of JPA and JDBC within this transaction?

Meaning, will the transactional handling still work as expected where if an rollback happens, it will rollback all JPA and JDBC changes?

The JPA access would be done through Spring Data repositories and the JDBC access through JdbcTemplate.

CodePudding user response:

No there is no issue. As both JPA and JDBC simply execute SQL in the same transaction.

  • Related