Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import time
- import cx_Oracle
- def do_connection():
- print 'waiting to connect'
- con = cx_Oracle.connect(user=user, password=pw, dsn=dsn, cclass="blah", purity=cx_Oracle.ATTR_PURITY_SELF)
- cur = con.cursor()
- print 'waiting to query'
- cur.execute('select sysdate from dual')
- print cur.fetchall()
- cur.close()
- con.close()
- time.sleep(30)
- user = '*'
- pw = '*'
- dsn = '*'
- pids = []
- for x in range(100):
- pid = os.fork()
- if not pid:
- do_connection()
- os._exit()
- else:
- pids.append(pid)
- for pid in pids:
- os.wait()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement