[ZODB-Dev] PROPOSAL: Explicit transactions for ZODB4
Phillip J. Eby
pje at telecommunity.com
Mon Apr 28 12:08:17 EDT 2003
At 04:59 PM 4/28/03 +0200, Christian Theune wrote:
>Hi.
>
>* Phillip J. Eby <pje at telecommunity.com> [030428 16:53]:
> > At 03:53 PM 4/28/03 +0200, Christian Theune wrote:
> > >Do i understand it right that transactions could be reused from another
> > >thread later on?
> >
> > Do you mean to ask:
>
>Ok, sorry for having been unclear. This is not my area of expertise, but I was
>thinking if this could make the management of long running transactions
>possible.
>
> > * Can you reuse the same transaction manager object repeatedly for
> > different transactions, each handled by a different thread (but with no
> two
> > threads at the same time)? If so, then yes.
>
>That's what I actually meant. So if I understand correctly, one could have a
>high level transaction manager for Zope which would hand out transactions
>e.g. based
>on session state?
Yes. Keep in mind you need a separate connection for each one as
well. But assuming you had a session of some type that was associated with
a ZODB connection (and thus a transaction), you could easily manage a
situation of this type.
>(Would that have worked before?)
With ZODB4 you might've been able to write code using suspend() and
resume() to do it, but the coding would probably be both more complex and
more error-prone. I imagine that with Shane's 'setLocalTransaction()', you
probably would've been able to do it too.
>And yes: I know there are a lot more
>problems about long running transactions via HTTP.
Indeed. For one thing, the odds of a conflict occurring between all those
outstanding transactions would get very high.
More information about the ZODB-Dev
mailing list