I have sequence of table data creation in transaction, using springboot, java, jpa and hibernate sequence shown below. Database used is Oracle
- Place order - insert into order details_table
- Process Payment - insert into payment_info table
- Error Message(info, warning, error) - insert into error_message table
I am inserting error messages in error_message table if any error occurs(info, warning, error).
My info and warning message get persisted into error_message if no error occurs during the processing of the request.
But if there is an error, I am throwing an error from code to rollback the transaction, its working but my error_message also get rollback.
I want to rollback details_table and payment_info but not the error_message, I want them to be persisted.
How I can achieve the same?