I just upgraded to cx_Oracle 4.1.2, for the SessionPool.drop() method.
Unfortunately, it doesn't do what I expected. I wanted to use it to
remove a connection from a SessionPool after the Oracle server is bounced.
Here is what happens in practice:
>>> import cx_Oracle as cx
>>> p = cx.SessionPool( 'user', 'password', 'host/dbname', 0, 10, 2)
>>> co = p.acquire()
>>> p.busy, p.opened
(1, 2)
[restart the databaase at this point]
>>> p.drop(co)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
cx_Oracle.DatabaseError: ORA-03113: end-of-file on communication channel
>>> p.busy, p.opened
(1, 2)
As you can see, SessionPool.drop() raises an exception instead of getting
rid of the dead database connection. Is this what's supposed to happen?
If so, can someone explain the purpose of drop()?
|