Spring magic – Nested transactions
The problem: Import a large number of items into a database, commit valid ones, and keep track of invalid ones. All in a single transaction. Traditional solution: Tedious to write. Programatically start a transaction and set a savepoint for each processed item. Rollback to savepoint if an exception occurs or commits if all ok. Spring solution: Easy, just modifying the…
Read More