You can implement two-phase commit instead. It requires a bit of additional planning in terms of data management but I actually find it much more elegant and it scales better. DB transactions are expensive and unnecessarily complicated.
You can have a really simple two-phase commit system where you initially mark all records as 'pending' and then update them as 'settled' once all the necessary associated rows have been inserted into their respective tables. You can record a timestamp so that you know where to resume the settlement process from. I once had multiple processes doing settlement in parallel by hashing the ids to map to specific processes so it scales really well.