this may not be specific to Webware but may interest everybody.
When I create an application using Mode-View-Controller, I could have, e.g. a Python class for the controller and several Cheetah templates for the views. I'll also have a class defining the model for an object. But, in an multi-threaded environment, how can I assure that only one thread updates a given object at a time? Should I implement a lock with timeout control (unlock if no method is called within a amount of time)?
I would prefer something like a multi-version-control, like PostgreSQL implements. So if a user requests an to update a object, it will be copied first into his session. Any simple modifications will be done in the session object. When he commits the update of the object (possibly with data collected with several HTML forms) the model-object associated to the data stored in the session, will try to update the database (in PostgreSQL 'SELECT ... FOR UPDATE'?), and will call any other business rules to update related information in a database transaction (could be like a delete followed by a create). If a timestamp comparison gives the result that the object has been updated in the meanwhile by another user, we could ask to overwrite it, or open a new window showing the last stored version.
How would you implement the storage of old object versions? In RDBMS or pickle? Other solutions?
Thanx in advance,