[Qt-interest] QSqlDatabase
Diego Schulz
dschulz at gmail.com
Wed Dec 10 18:45:56 CET 2008
On Mon, Jan 7, 2008 at 8:01 PM, Rick Vernam <rickv at hobi.com> wrote:
> At some point after connecting to a Postgresql database via QSqlDatabase, I
> cause an unexpected disconnect (ie, pull the ethernet cable from the
> computer).
> After that, I check database->isOpen(), and it says true.
> So, I try to database->exec(some_query), and it hangs (for at least 2-3
> minutes, perhaps longer).
>
> what is the preferred method of:
> 1 - identifying database disconnect
> 2 - prevent QSqlDatabase::exec(...) from hanging
>
> Of course one option is to create a threaded wrapper class.
> Other ideas?
>
> Thanks
>
>
>
Hi,
I was trying to figure out a clean way to detect database disconnects
(obviously is only relevant when connecting to remote databases). I'm using
PostgreSQL and my client application connects over a poor link (ie wifi).
Eventually the connection is lost causing the application to become
unresponsive as described by Rick.
Anybody there can suggest a way to detect and react database disconnects?
Thanks in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20081210/00e7f08c/attachment.html
More information about the Qt-interest-old
mailing list