Re: [cx-oracle-users] cx_Oracle opens an excessive number of sessions
Brought to you by:
atuining
From: Amaury F. d'A. <ama...@gm...> - 2010-09-27 17:16:03
|
Hello, We just encountered a similar issue where there were too many processes on the DB server. the number of rows in v$process was much higher that the number in v$session. Eventually some programs get an error: "ORA-00020: maximum number of processes exceeded" Here we have a bunch of processes that use a database connection, then "go to sleep" for a while. They do close the connection, but the object is kept in a global variable. I think this is a bug in cx_Oracle: when connection.close() is called, OCISessionEnd() is called, but OCIServerDetach() is not. It will be called only by connection.__del__, when the connection object is itself destroyed. I tried to move the call to OCIServerDetach() in Connection_Close, and indeed the occurrence in v$process disappears when I call connection.close(). Since a closed connection is unusable and the OCIServer handle cannot be reused, it makes more sense to free this resource sooner. Or course the workaround is to delete the connection object, with a "conn=None" or similar. But cx_Oracle should be changed IMO. What do you think? 2010/7/28 rwe <rog...@to...>: > Hi, > I have been chasing a similar problem. > The same code runs on several constellations without problem, except for > one where I get an > excessove number of processes on the DB server. Killing the process gets > rid of them. > > I will check to see what version of cx_Oracle, Oracle client and Oracle > are in use, as I > am pretty sure that it is a praticular combination that produces the > problem. -- Amaury Forgeot d'Arc |