On Nov 2, 2007, at 11:03 AM, Matthew Newhook wrote:

>
> I've posted a synopsis of this on the earlier referenced pylons thread
> to see what those guys have to say.
>
> I don't think this is really an AJAX specific problem - although the
> asynchronous nature of AJAX means its more likely to occur. It seems
> to me that any http request can arrive concurrently at the web server
> from the same web browser sharing the same token or session -- unless
> the app server (pylons) in this instance serialized access to the
> controller under these circumstances then concurrent access to the
> same data model could easily occur. Perhaps SQLAlchemy could
> optionally cache any in-memory models and return the same instance to
> multiple threads so that local serialization on the model could take
> place?

I'd have to disagree here; SQLAlchemy is a database access library,  
its not a caching or application framework.  Providing a thread- 
synrchronized caching container would be the job for Pylons or some  
other third party software (or roll your own).   Also this solution  
wouldn't work for application models that are non-threaded (like  
process-split models); out-of-sync requests would still hit a locked  
database.   The two ways to fix this would be to either serialize GUI  
events at the AJAX level, or to get the database to allow graceful  
locking.

I do think this is primarily an AJAX-specific issue, at least within  
the field of web applications; the closest analogy for a non-AJAX web  
application is the "double post" issue, which is not nearly as  
prevalent as this one is since while a single non-ajax webpage by  
definition should issue only one POST (and simple tokens can be used  
to prevent a second post), a single ajax webpage can issue any number  
of requests in any order, without the previous requests having yet  
completed. 

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" 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/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to