Pylons works superbly out-of-the-box with SQLAlchemy if your web application
solely responds to HTTP requests.
However, it seems to me that most non-trivial web applications (including mine)
will inevitably need to have additional threads performing other tasks, e.g.
mail send/receive, that also need to access the database.
As soon as this happens, you run into the database locking issue.
My question is what do people suggest are the best approaches for a database
locking scheme using Pylons and SQLAlchemy?
Crudely, it seems pretty easy to introduce a lock that is acquired each time a
controller action is called and then released each time that controller action
returns. The other threads then have to lock and release when they use the
database. In this way, the individual controller methods do not have to worry
about the locking issue.
However, not all controller methods need to access the database and not all the
lines of code in a controller method need to lock the database. Therefore, an
unnecessary bottleneck is introduced by this approach.
It may also be that I've missed some pre-existing architecture/framework to do
this :-)
All suggestions greatly appreciated.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---