Hello Patrick Gerardi,
If these are your two options then I would go for the second option, because committing your transaction within the loop directly will lead to performance problems.
However, there are maybe some extra steps you can take:
1. Can you process the transaction lines in separate batches and separate actions for example 100 * 10 000 or 1000 * 1000
2. If not try at least to split them in batches within the same action
3. If you do option 2 put an Index on the table ID(but only if you read/retrieve actions are outnumbering the create/delete actions
Hope this helps,
Good luck!