The MiddleKit ObjectStore now keeps track of new objects, modified
objects and to-be-deleted objects on a per-thread basis. This prevents
the ObjectStore from trying to save the same changes twice, and prevents
the situation where one thread commits an object which a different
thread modified (and wasn't necessarily ready to commit).  

This new tracking is enabled when your ObjectStore is in "Threaded"
mode, which is enabled by default.  You can run in single-threaded mode
by adding the following line to the Settings.config file in your model
directory:
    'Threaded': 0,

The behaviour of the following methods has changed:
    - saveChanges() - now commits only objects which were modified by
the current thread

New ObjectStore methods:

    - hasChangesForCurrentThread() - returns whether the store has any
uncommitted changes for the current thread

    - saveAllChanges() - commits all added/modified/deleted objects to
the database, regardless of which thread made the changes. This could be
called on application exit just to be extra safe. When using MiddleKit
from WebKit, though, you be calling saveChanges() at the end of any
request which modifies MK objects, so I recommend putting "assert not
store.hasChangesForCurrentThread()" into your SitePage.sleep() method to
catch programming errors early.

For upgrading older MiddleKit applications, you'll probably want to
replace any calls to store.hasChanges() with
store.hasChangesForCurrentThread(). Nothing else should need to change.

Please report any problems to me.

-- 
Jason D. Hildebrand
[EMAIL PROTECTED]



-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm 
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to