Created
May 22, 2013 09:41
-
-
Save h3xh4wk/5626416 to your computer and use it in GitHub Desktop.
cx_Oracle with threads
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cx_Oracle | |
CONN_STR = """(DESCRIPTION= | |
(ADDRESS=(PROTOCOL=tcp)(HOST=%s)(PORT=%s)) | |
(CONNECT_DATA=(SID=%s)))""" | |
CONN_STR = CONN_STR % (host, port, sid) | |
conn = cx_Oracle.connect(user, pwd, CONN_STR, threaded=True) # can connect using multi threads | |
conn.autocommit = True # will always use because could not figure out the place for explicit commit | |
""" | |
if not hasattr(self, "conn"): | |
self.conn = conn | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment