Use of cclass causes connection leaks

Issue #2 resolved
John Steenbruggen
created an issue

Setting the cclass parameter in cx_Oracle.connect() and then calling connection.close() doesn't close the connection. You can see this by

Adding a test case to like:

def testCClassClosing(self):
    "test connections are closed when using cclass"
    for i in xrange(1,5000):
        connection = cx_Oracle.connect(self.username, self.password,
                                       self.tnsentry, cclass='myclass')
    import time

Because the connections aren't closed you probably see: DatabaseError: ORA-12520: TNS:listener could not find available handler for requested type of server

If the test makes it to the sleep call, you can use netstat to see all of the connections are still in the ESTABLISHED state with the DB until the program exits.

The reason for wanting this to work is so I can test DJango and Oracle's DRCP with a simple configuration change. I see if I use cx_oracle pooling the pool.release(connection) call does close the connection, but that option doesn't fit my requirements.

Comments (1)

  1. Log in to comment