[PyGreSQL] ValueError - among other things - update

Thys Meintjes thys at netsys.co.za
Wed Mar 6 15:44:24 EST 2002


Greets,

A while ago I queried this list on the problem discussed at length below. I
fixed the 'bug' and because it is such a insidious bastard I thought I'd
share the solution.

It has to do (I think) with the thread safety of postgress or PyGreSQL. To 
make a short story shorter I used a singleton 'DBBroker' object throughout my
multithreaded App to handle all DB interaction (a fairly large +7M wxPython
based GUI). Needless to say once I gave each thread its own DB connection my
problem went away.

Why all these lead to ValueErrors etc. I haven't bothered to investigate.

regards
thys

On Wed 27 Feb 02 12:53, you wrote:
> Greets all,
>
> I have a more or less static set of tables. From time to time I get
> unexpected 'ValueError' exceptions when querying these tables (+- 20% of
> queries).These VallueErrors are always accompanied by the 'while idle'
> messages. There's also a long time delay while the (I presume) psqllib lib
> calls either timeout or returns with the exception.
>
> In attempt to keep things alive I've caught these exceptions and reconnect
> to the DB, thats where the DB Error... msgs come from, the rest are
> PyGreSQL and psqllib (once more I presume) error messages.
>
> In short: How do I get rid of these VallueError messages and have joy ?
>
> Suggestions, rebukes etc. eagerly awaited.
>
> regards
> thys
>
> -----output snippage
> message type 0x50 arrived from server while idle
> DB Error, trying to reconnect.
> M40server sent data ("D" message) without prior row description ("T"
> message) message type 0x59 arrived from server while idle
> message type 0x50 arrived from server while idle
> DB Error, trying to reconnect.
> message type 0x5a arrived from server while idle
> M40server sent data ("D" message) without prior row description ("T"
> message) message type 0x59 arrived from server while idle
> -----output snippage
>
> environment:
>
> redhat 7.2
> postgresql-libs-7.2-1PGDG
> postgresql-tcl-7.2-1PGDG
> postgresql-server-7.2-1PGDG
> postgresql-7.2-1PGDG
>
> PyGreSQL-3.3-pre011203

-------------------------------------------------------




More information about the PyGreSQL mailing list