Webware for Python 0.8
The ObjectStore 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:
The behaviour of the following methods has changed:
New ObjectStore methods:
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 calls to store.hasChanges() with store.hasChangesForCurrentThread(). Nothing else should need to change.
Support for the SQL 'decimal' type, previously found only in the MSSQL adapter, has been brought up to the generic SQL adapter level which means that MySQL inherits it. Use the attribute keys Precision and Scale to specify the precision and scale just like you see in SQL manuals: decimal(precision, scale).
If (and only if!) you have "legacy" code from the old decimal support, you could enable the UseMaxForDecimalPrecision setting. However, you might get fried down the road when MiddleKit starts enforcing min/max constraints on decimal types. (Getting fried implies you would have to edit/fix your model.)
"Dangling obj refs" now print much more useful information. The old message:
WARNING: Obj ref dangles. dec=266287972390 hex=3e00000026 class.obj=Stop.97.
The new message:
WARNING: MiddleKit: In object <PendingTrade 'TIVO long 4.25' 129>, attribute Trade.initialStop dangles with value Stop.97
In other words:
WARNING: MiddleKit: In object <REPR()>, attribute FULL ATTR NAME dangles with value CLASS.SERIAL_NUM VALUE