When using a database transaction to group multiple updates, should I include SELECTs inside the transaction as well? For instance, lets say I:
- get a record
- check edit permissions for that record, using data from the record
- update some records
- update some other records
Should I start the transaction before the "get a record" stage, or just around the updates?
I'm using Postgres/Django transaction.atomic()
but I don't think it matters here.