[Zope-DB] Per-user connections

Dieter Maurer dieter@handshake.de
Fri, 6 Dec 2002 23:43:11 +0100


Yves Bastide writes:
 > Dieter Maurer wrote:
 > > ...
 > > Synchronization is also difficult with pure RAM based sessions,
 > > such as ZSession.
 > 
 > Can you elaborate?  Problems with storing objects in the session object, 
 > with lifetime?
Transaction control is usually done at the connection level.
This implies that concurrent (unsynchronized) threads must not share
the same connection (as otherwise "commit/rollback" in one thread
will affect the other (unaware) thread).

When you put a connection in a session, there is no garantee
that two threads (belonging to the same session, e.g.
handling different requests from a frame based appliciation)
do not share the same connection.
Unless appropriate synchronisation is used, non-deterministic
transaction behaviour may be the consequence.


Dieter