Necessity of explicit cursor.close()

前端 未结 5 1960
既然无缘
既然无缘 2020-12-28 13:57

From time to time, I\'m executing raw queries using connection.cursor() instead of using ORM (since it is definitely not a silver bullet).

I\'ve noticed that in seve

5条回答
  •  -上瘾入骨i
    2020-12-28 14:43

    While the operating system can normally be relied upon to release resources, it's always good hygiene to close things like database connections to ensure resources are released when no longer required, the really important thing from a database point of view is to ensure that any changes are commit()ed.

提交回复
热议问题