help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] Postgres and blocked poll


From: Holger Hans Peter Freyther
Subject: [Help-smalltalk] Postgres and blocked poll
Date: Thu, 21 Apr 2011 12:15:11 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15) Gecko/20110411 Lightning/1.0b2 Thunderbird/3.1.9

Hi Paolo,

I have one more issue with the Postgres DBI driver. In case of the VPN
vanishing (or suspend/resume my laptop) the next database query will call
PQgetResult which will block in poll forever.

According to the Postgres documentation one can get the socket from the
connection, use the PQconsumeInput to make PQ read it and there is something
like PQisbusy.

Now the question is how to integrate this. Whenever executing a query I could
greate a FileDescriptor, wait until it is readable, call PQconsumeInput..

[
   PQisBusy..
] whileFalse: [
   (FileDescriptor on: connection socket) ensureReadable.
   PQConsumeInput..
].

Does this sound okay? This would just leave the issue when connecting.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]