Issue
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.
Solution
No there is no issue. As both JPA and JDBC simply execute SQL in the same transaction.
Answered By - Simon Martinelli
Answer Checked By - Marilyn (JavaFixing Volunteer)