Handling errors in springboot transactions
I have a scheduled method that is supposed to run once a week (Method A). Method A makes a call to private Method B which is responsible to deleting certain records from my DB. I have marked Method A as Transactional because I want the deletion rolled back in the case of an issue. My problem is how can I log and gracefully recover from an exception? It is my understanding (and my local tests have shown) that if I add a try/catch inside Method A, the rollback will not occur.
Entity Getting Updated Even though it is not in the Transaction context Using Modifying and Transactional Annotation in Spring boot
I am updating a table mapped to an entity “ChildEntity” using @modifying, @Transaction and @Query Annotation in repo method as shown below
Entity Getting Updated Even though itis not in the Transaction context Using Modifying and Transactional Annotation in Spring boot
I am updating a table mapped to an entity “ChildEntity” using @modifying, @Transaction and @Query Annotation in repo method as shown below