[wxpython-users] Abort connecting to a database (threading)

Rickey, Kyle W Kyle.Rickey at bakerhughes.com
Thu Sep 11 09:46:10 PDT 2008


Sorry for the late response, but here is what I worked out to connect
via odbc (win32) with a specified timeout. Hope this helps.

 
-Kyle Rickey
-----Original Message-----
From: wxpython-users-bounces at lists.wxwidgets.org
[mailto:wxpython-users-bounces at lists.wxwidgets.org] On Behalf Of
Alastair Medford
Sent: Saturday, September 06, 2008 11:30 PM
To: wxpython-users at lists.wxwidgets.org
Subject: [wxpython-users] Abort connecting to a database (threading)

Currently I'm trying to write code that will let me connect to a
database while have an option to cancel, since if the program cannot
connect to the database it takes a long time to timeout. I believe
threads are the best way to do this, but I'm a bit confused about how
to cause an abort. From the examples I've looked at,
(http://wiki.wxpython.org/index.cgi/LongRunningTasks ), it seems like
I have to make the second thread poll to see if an abort has occurred,
and then react from there. The problem is connecting to a database
doesn't involve a loop or anything, it's just running a single
function. Since this is the case, is there any other way to check for
an abort other than polling? Or is this just not possible? If it has
to be done via polling, the only way I can think of doing this would
be to edit the database library to check for an abort while it's
checking for a response from the database, which would be way beyond
my ability.

Thanks,
-- 
Alastair Medford
_______________________________________________
wxpython-users mailing list
wxpython-users at lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: database_test.py
Type: application/octet-stream
Size: 492 bytes
Desc: database_test.py
Url : http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/20080911/cf9a5a9a/database_test.obj


More information about the wxpython-users mailing list