[FRPythoneers] postgres and python?
kperacles at yahoo.com
Sun Mar 31 21:08:18 MST 2002
--- Evelyn Mitchell <efm at tummy.com> wrote:
> * On 2002-04-01 03:20 Karl Putland <kperacles at yahoo.com> wrote:
> > Which modules have people used?
> I use psycopg.
> > psycopg, I'm having troubles using it with Webware.
> Why do you think this is a psycopg problem and not a Webware
Well, I haven't been able to use any other adapters, so I can't
confirm that it is or isn't Webware. It could be quite a
combination of things.
I'm experimenting with PyDO from the Skunkweb folks. PyDO uses one
connection, so I tweaked the point where it gets a connection into
a hashmap that includes threading.currentThread().getName() so that
it uses one connection per thread. This works somewhat. As I watch
the console for the Webware app server, I can see the print
statements that I used to mark the creation and allocation of
connections. But during use of the servlet, only some of the
threads actually see the commited insert. There are also sporatic
errors related to conncurrent update even though it is running on
my laptop and I am the only one accessing the Webware application
PyDO uses connections transiently in its data objects meaning that
it doesn't hold a reference to the connection as an instance
variable. This is good for putting the data objects onto the
session in Webware, and allows connections to be reused by other
objects in the same thread. It also avoids the possibility of
pickling the database connection object into the session when I
store a data object.
The thing that worries me is that PyDO does lots of black magic
with meta classes and static methods. This worry is offset by the
convenience of its schema extraction code.
I need to do a test that is isolated to psycopg to determine more
precisely where the issue is.
Do You Yahoo!?
Yahoo! Greetings - send holiday greetings for Easter, Passover
More information about the FRPythoneers