Django transaction.atomic() on single operation prevents race conditions?
Why I need to use atomic() when I have only 1 db operation inside atomic block? My AI-assistant tells me that it prevents race conditions, but I don't use select_for_update() inside. It tells that db looks on unique constraints and sets lock automatically but only when I use atomic(), but if I will use it without atomic() race conditions can be happened.
Is it true? Can you explain this behaviour? I don't understand how it works if I have only one db operation inside.
Code example:
with atomic():
Model.objects.create(....)