lost connection
Andy Jewell
andy at wild-flower.co.uk
Tue Nov 11 13:14:24 EST 2003
On Thursday 06 Nov 2003 10:20 pm, Alberto Vera wrote:
> I forgot to write this:
> ...I unplug and 10 seconds later I plug the wire..
>
> Regards
> ----- Original Message -----
> From: Alberto Vera
> To: python-list at python.org
> Sent: Thursday, November 06, 2003 5:06 PM
> Subject: lost connection
>
>
> Hello:
> I use these lines to connect to a database:
>
> conn = win32com.client.Dispatch('ADODB.Connection')
> conn.Open('Provider...)
>
> But I have a problem: If I unplug the wire(network) then I can't make
> anything to a database.
>
> I thought the conn.State has changed but allways has the same value of 1.
>
> Do you think is it a bug on Python?
>
> Thanks
>
>
>
>
> ---------------------------------------------------------------------------
>---
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
alberto,
if your telephone cord got cut during a phone conversation (maybe by a
villain, like in the movies) would you expect to be able to carry on the
converstaion again, without re-dialling, once the wire was repaired?
That's more-or-less what you're asking your program to do. To get this type
of effect, it's best to do a connect-work-disconnect cycle - you shouldn't
really keep database connections alive for protracted periods of time. If
you do it this way, you don't really have to worry too much about losing your
connection: just trap the condition and re-try...
hth
-andyj
More information about the Python-list
mailing list