When you say don't forget about the GIL, what should I not be
forgetting? I'm using sqlite and the following:

<<<<<<<<<<<<<<<code>>>>>>>>>>>>>>>>>>>>>>>>>>

thread_lock = threading.RLock()

def db_execute(sql):

    thread_lock.acquire()

    try:
        connection = sqlite3.connect(database_name)
        cursor = connection.cursor()
        cursor.execute(sql)
        connection.commit()
    except:
        log.error(formatExceptionInfo())
    finally:
        thread_lock.release()

<<<<<<<<<<<<<<<code>>>>>>>>>>>>>>>>>>>>>>>>>>
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to