Re: [cx-oracle-users] SessionPool.drop() fails
Brought to you by:
atuining
From: Anthony T. <ant...@gm...> - 2006-01-19 04:13:39
|
Unfortunately, restarting the database also destroys the pool that you set up. :-( That's the way Oracle works. You'll need to write code yourself to handle that situation. The sessionPool.drop() method is used when you have a connection or set of connections that have become "bad" for some reason -- the session has been killed (alter system kill session command) or a ORA-600 or similar error has occurred making the session unusable. You might also want to use it if you find that the session is "bad" for some other reason -- some application reason, that is. Hope that explains things. On 1/18/06, Forest Wilkinson [sf] <mo...@ti...> wrote: > 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 =3D cx.SessionPool( 'user', 'password', 'host/dbname', 0, 10, 2) > >>> co =3D 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()? > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi= les > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D103432&bid=3D230486&dat= =3D121642 > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |