You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My question is about transactionality. I have verified that in case of an error in an insertion in the first table, an exception is thrown and no data is inserted into the database. On the contrary, if the error occurs in the second table to be processed, the data from the first table is inserted, so all changes are not rolled back.
Is it possible to rollback both tables in case of error in the second table?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a class with CompositeItemWriter that writes to two tables. Following the example of:
writing-in-multiple-unrelated-tables-in-spring-batch-writer
My question is about transactionality. I have verified that in case of an error in an insertion in the first table, an exception is thrown and no data is inserted into the database. On the contrary, if the error occurs in the second table to be processed, the data from the first table is inserted, so all changes are not rolled back.
Is it possible to rollback both tables in case of error in the second table?
Here my code:
Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions