What causes Transaction Pool Error?

I am using a Python loops to write many transactions simultaneously. If I do not put sleep() between every iteration, I get error such:

algosdk.error.AlgodHTTPError: {“message”:“TransactionPool.Remember: transaction already in ledger: N6DGJLF4PQEJRW4LBELO562XWX7LUXRCGIQETB5ZTLO2C42BRAJQ”}

Or sometimes even when I add sleep time in between, loop will iterate a few times then the same error happens. What’s the reason behind this? Is it because I can only try to commit 1 transaction into 1 block at a time. And If I try to commit 2 transactions to 1 block, it will generate the same transaction ID which then causes the error?

Thank you

All transactions need to be unique to be included in the blockchain. You can add a monotonic growing counter and store it in the notes field in order to do that.