[Twisted-Python] long-lived database transaction

Federico Di Gregorio fog at initd.org
Sat Dec 13 16:50:50 EST 2003

Il sab, 2003-12-13 alle 21:55, Christopher Armstrong ha scritto:
> Federico Di Gregorio wrote:
> > Hi *,
> > 
> > attached to this mail there are two files that implement long-lived
> > database transactions for twisted (xdbapi.py, to be dropped in
> > twisted.enterprise) and the necessary unit tests (test_xdbapi.py). 
> This looks like a gigantic rape'n'paste of adbapi.py. Isn't there a way 
> you can integrate with/refactor adbapi such that you don't duplicate all 
> that code?

the original code was very different from adbapi, but i wanted to
provide a similar interface. that's why i rape'n'pasted. :)

unfortunately the adbapi code is based on a *thread* pool and the
connection pool is just a side-effect of using one connection per thread
(this is completely wrong, imho, see my comments of about one year ago
about adbapi on this very list.) anyway, this obviously makes impossible
to have long-lived transactions. 

i would be very happy to convert adbapi to a *real connection pool* and
add long-lived transactions to it (very much like xdbapi incorporates
one-shot transactions that mimic ConnectionPool.runXXX, look at the
code) but i tought it was less invasive to first provide a completely
separate implementation, starting with xdbapi.

> Also, please create a "Feature"-level issue on the bug tracker for this 
> patch (especially since the patch needs discussion):

ok. let's discuss it and i'll resubmit the patch after.


Federico Di Gregorio                         http://people.initd.org/fog
Debian GNU/Linux Developer                                fog at debian.org
INIT.D Developer                                           fog at initd.org
   Lasciate che i furetti vengano a me. -- Maria Luisa Benedetta Panzani
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Questa parte del messaggio =?ISO-8859-1?Q?=E8?= firmata
Url : http://twistedmatrix.com/pipermail/twisted-python/attachments/20031213/79ff44bd/attachment.pgp 

More information about the Twisted-Python mailing list