<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2802" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=528294218-08042006><FONT face=Arial size=2>The code used for
connecting and retrieving data from PostgreSQL is quite simply
this:</FONT></SPAN></DIV>
<DIV><SPAN class=528294218-08042006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=528294218-08042006><FONT face=Arial size=2> dbconn =
getDatabase('name_of_psycopgda')()</FONT></SPAN></DIV>
<DIV><SPAN class=528294218-08042006><FONT face=Arial size=2> rows =
queryForResults(dbconn, sql)</FONT></SPAN></DIV>
<DIV><SPAN class=528294218-08042006><FONT face=Arial size=2> return
rows</FONT></SPAN></DIV>
<DIV><SPAN class=528294218-08042006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=528294218-08042006><FONT face=Arial size=2>Running this bit of
code fails about 3 out 4 times; the traceback:</FONT></SPAN></DIV>
<DIV><SPAN class=528294218-08042006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=528294218-08042006><FONT face=Arial size=2>
rows = queryForResults(dbconn, sql)<BR> File
"/usr/share/Zope32/src/zope/app/rdb/__init__.py", line 408, in
queryForResults<BR> raise
DatabaseException(str(error))<BR>DatabaseException: Shouldn't load state for
0x28 when the connection is closed</FONT></SPAN></DIV>
<DIV><SPAN class=528294218-08042006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=528294218-08042006><FONT face=Arial size=2>I've tried setting
the threadsafety=2 on the database adapter to no avail. Has anyone else
seen this problem?</FONT></SPAN></DIV>
<DIV><SPAN class=528294218-08042006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=528294218-08042006><FONT face=Arial
size=2>Thanks,</FONT></SPAN></DIV>
<DIV><SPAN class=528294218-08042006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=528294218-08042006><FONT face=Arial
size=2>Keith</FONT></SPAN></DIV>
<DIV><SPAN class=528294218-08042006><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=528294218-08042006><FONT face=Arial size=2>p.s. Zope
3.2</FONT></SPAN></DIV></BODY></HTML>