Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Mar 21st, 2013  |  syntax: Python  |  size: 0.67 KB  |  hits: 47  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import os
  2. import time
  3. import cx_Oracle
  4.  
  5.  
  6. def do_connection():
  7.         print 'waiting to connect'
  8.         con = cx_Oracle.connect(user=user, password=pw, dsn=dsn, cclass="blah", purity=cx_Oracle.ATTR_PURITY_SELF)
  9.         cur = con.cursor()
  10.         print 'waiting to query'
  11.         cur.execute('select sysdate from dual')
  12.         print cur.fetchall()
  13.         cur.close()
  14.         con.close()
  15.         time.sleep(30)
  16.  
  17.  
  18. user = '*'
  19. pw = '*'
  20. dsn = '*'
  21. pids = []
  22. for x in range(100):
  23.         pid = os.fork()
  24.         if not pid:
  25.                 do_connection()
  26.                 os._exit()
  27.         else:
  28.                 pids.append(pid)
  29. for pid in pids:
  30.         os.wait()