[Zope-dev] RDBM Connections per User

Christian Theune ct@gocept.com
Tue, 5 Jun 2001 23:47:18 +0200


Hello out there.

I had following problem:

In a software, using zope as appserver, we needed to have every user
a single connection to the database (postgres 7.1) to have access-
checks on database level.

I hacked into the Connection code and found, that the interfaces are
really hard to be used for this feature.

The thing is, that many "people" are accessing the database connection
handle directly whether I am using now a wrapper function "getConnection()"
to get the current connection or open one.

I am reading the current user out of the REQUEST["AUTHENTICATED_USER"] and
am storing the handles in an _v_connections Dictionary, which is explicitly
not stored in database, but lets every user have exactly one connection.

Any comments on this?

-- 
Christian Theune - ct@gocept.com
gocept gmbh & co.kg - schalaunische strasse 6 - 06366 koethen/anhalt
tel.+49 3496 3099112 - fax.+49 3496 3099118 mob. - 0178 48 33 981

reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))