Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

Should I avoid using unnecessary db transactions (django+postgresql environment)?

I'm using Django, using a Postgres DB, and I wonder: say I have a function like this:

def yay_func(obj):
    log('yay')
    obj.is_yay = True
    obj.save()

If I wrap this function in a transaction, will I cause any strain on my db? I checked the Django connections object, so I know another db request is made for creating a "save point", but I wonder if it's something I should consider when I'm trying to optimize my performance.


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

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...