I must add a lot of records to Sqlite database(4 threads) in one time but I have only 4 records in database. Code is iterating correctly.
Code snippet:
def inserter(filename):
    count = len(open(filename, 'rU').readlines())
    print str(count) + " " + filename
    for counti in range(count):
        conn = sqlite3.connect('passes.db')
        c = conn.cursor()
        m = hashlib.sha256()
        x = linecache.getline(filename, counti)
        print x + filename
        m.update(x)
        hashe = m.hexdigest()
        x = str(x)
        c.execute("INSERT INTO `passes`(`hashed`,`pass`) VALUES (?,?)", (hashe, x))
    conn.commit()
    conn.close()
    iter = ["aaa","aab","aac","aad"]
    for it in iter:
        p = multiprocessing.Process(target=inserter, args=(it,))
        p.start()
        p.join()
        print("process with id %s for file %s started" % (str(os.getpid()), it))