Here is the script I am using. As I stated in the above message, the weird thing is I only get the disconnect when running the rw-split script against the remote server.
#!/usr/bin/env python2.4
import atexit
import MySQLdb
def main(host, port):
port = int(port)
pool = list()
for i in range(20):
print i,
try:
conn = MySQLdb.connect(db='xx', user='xx', passwd='xx', host=host, port=port)
except MySQLdb.Error, e:
print e
else:
print 'ok'
cursor = conn.cursor()
#res = cursor.execute("set names utf8")
pool.append((conn, cursor))
atexit.register(conn.close)
return pool
if __name__ == '__main__':
import sys
main(*sys.argv[1:])
Edited 1 time(s). Last edit at 10/29/2007 10:24AM by Ludovico Magnocavallo.