Re: [cx-oracle-users] How to transparently re-connect using cx_Oracle?
Brought to you by:
atuining
From: Anthony T. <ant...@gm...> - 2006-10-05 16:23:07
|
On 10/4/06, Laurelin of Middle Earth <la...@fn...> wrote: > Unfortunately, this won't work for the case I'm trying to solve > because the connection that is given to me is (and must remain) > a cx_Oracle.Connection. No matter how I wrap it and mungle it > at my end, the connection that the caller has passed me *is* > the connection. If I change it or reconnect, then essentially > I am using a *new*, separate connection, and the caller still > has its dead connection. > > Unless the cx_Oracle.Connection instance knows how to reconnect > itself.... It doesn't currently -- but its entirely possible that it could. Of course any current cursors would be invalidated by such a move. That might end up causing more trouble than its worth.... As has already been noted attempting to restart something in the middle may not be very effective as well. Are you certain that this is the solution you need and would a reconnect() method help you? Would you need this "right away" as well? > Thanks, lauri > > Thus spaketh Amaury Forgeot d'Arc on 10/04/2006 03:22 AM: > > > [snippage] > > > > A solution could be to wrap both classes (connection and cursor) > > inside "RetryingConnection", "RetryingCursor" classes. They delegate > > all calls to their base objects, but the RetryingConnection.cursor() > > function returns a wrapped RetryingCursor. > ... > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > |