[Twisted-Python] mutexes in twisted.enterprise?

Sean Riley sean at twistedmatrix.com
Thu Apr 18 22:50:15 EDT 2002

well, knowing nothing about your application... relying on the order of rows
in a relational database table is generally a bad practice - this order is
really arbitrary and in some cases could actually change (depending on the
db you are using - clustered indices as primary keys for example). If you
want sequence information, I'd recommend you embed it in your rows - don't
rely on the order of the rows in the table.

anyway.. you can perform syncronous operations through a
twisted.enterprise.ConnectionPool by creating your own Transaction objects
and passing them to ConnectionPool::_runIteraction(). Maybe a queue with a
single db thread that you use syncronously?

twisted.enterprise needs more docs... especially the Row interface, but it
is good to hear that someone else is using it.

-----Original Message-----
From: twisted-python-admin at twistedmatrix.com
[mailto:twisted-python-admin at twistedmatrix.com]On Behalf Of Bob Ippolito
Sent: Thursday, April 18, 2002 8:14 PM
To: twisted-python at twistedmatrix.com
Subject: Re: [Twisted-Python] mutexes in twisted.enterprise?

Well see the thing is that yes, the db supports transactions [postgres],
but I need to make sure the db processes requests in the order that
they're received over the wire, not whenever that particular db
connection gets around to it.

I don't think I'm currently having issues w/ it right now, but I'm just
concerned that potentially it could be a problem someday.

On Thursday, April 18, 2002, at 09:04 PM, Andrew Bennetts wrote:

> On Thu, Apr 18, 2002 at 08:49:41PM -0400, Bob Ippolito wrote:
>> I'm doing some twisted.enterprise crap and I was wondering if it was
>> safe to use thread mutexes to make sure that only one interaction goes
>> at a time?  I have some queries that shouldn't run in parallel under
>> certain conditions and I believe forcing it w/ mutexes would be the
>> safest and easiest solution... but I haven't looked much into what's
>> going on under the hood and I'm wondering if it'll do Very Bad Things?
> Interactions all run inside a db transaction, I think (someone please
> correct me if I'm wrong).  So if your DB supports transactions, then you
> should be fine already.  I'm presuming that by "interaction" you mean
> twisted.enterprise.adbapi.Augmentation.runInteraction?
>> I'm using Twisted 0.15.2, I believe.. I don't want to upgrade at the
>> moment because it's in testing for a few weeks.
> So already we have legacy systems to support :)
> I'm not aware of any significant changes to twisted.enterprise since
> 0.15.2.
> -Andrew.
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Twisted-Python mailing list
Twisted-Python at twistedmatrix.com

More information about the Twisted-Python mailing list