[storm] Questions about DeferredStores on twisted-storm branch

James Henstridge james at jamesh.id.au
Wed May 12 03:23:36 BST 2010


On Tue, May 11, 2010 at 9:48 PM, Oscar Campos
<oscar.campos at open-phoenix.com> wrote:
> Yeah, that makes sense to me, so I already implemented it on this way.
>
> In my application I have twisted web resources loaded as "controllers", each
> resource can have a model object (storm object) attached on it that
> represents a database table, each model object owns a DeferredStore (or a
> Store) that depends on application configuration.

Hmm.  That doesn't sound like the best way to structure things.

Usually I'd associate the store with the current request (the
twisted-integration branch provides a store pool implementation which
you could use this for).  You'd then use that store for all the
database access done by the request.  Having a single request make
changes to a database via multiple connections simultaneously almost
always ends in tears :)

James.



More information about the storm mailing list