[cx-oracle-users] cx_Oracle opens an excessive number of sessions
Brought to you by:
atuining
From: Hannes B. <hab...@gm...> - 2010-07-22 07:27:07
|
I have a problem using instantclient 11.2 and cx_Oracle 5.0.3. When I query the database, cx_Oracle creates an excessive number of sessions to the database (about 70). I already crashed the database once, because I went over the allowed number of sessions (Oracle default is 150), after which my sysadmin increased the number of allowed connections to about 4000. However, he tells me I have to reduce the amount of resources I use and the number of sessions, so he can set the allowed number of connections back to something reasonable once the server goes into production. The one thing I tried was to set cursor.arraysize to something smaller, but it doesn't make any difference. This is was happens: import cx_Oracle db = cx_Oracle.connect(user, pass, dsn) # Nothing bad happens here cursor = db.cursor() # This is fine too cursor.execute('SELECT foo FROM bar") # Opens an excessive number of sessions cursor.fetchone() # Read some records cursor.fetchmany() cursor.close() # Doesn't close the many sessions db.close() # Closes the sessions. --Hannes |