Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
158 views
in Technique[技术] by (71.8m points)

python - is there any sense in select_for_update when using transaction.atomic?

@transaction.atomic()
def some_function():
    MyModelOne.objects.filter(name="Name").select_for_update().update(status='active')
    MyModelOne.objects.filter(code="abc").select_for_update().update(status='inactive')

Is there any sense in code above? Or just transaction.atomic() is enough?

question from:https://stackoverflow.com/questions/65939291/is-there-any-sense-in-select-for-update-when-using-transaction-atomic

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...