Does python (version 2.7, 3.3) close the database connection immediately after a program is finished?
For example:
import MySQLdb
conn = sqlite3.connect(host="localost", user="adam", password="12345", db ="my_db")
c = conn.cursor()
c.execute('''SELECT * FROM MY_TABLE''')
cur.close() # Do I really need that ?
conn.close() # Do I really need that ?
Could there be an issue with closing connections, if I run this script again and again immediately one after another?
ps. Yes, I know that the best practice is to close all the resources.