Update of /cvsroot/webware/Webware/MiddleKit/Docs
In directory usw-pr-cvs1:/tmp/cvs-serv4864
Modified Files:
RelNotes-0.8.html
Log Message:
Documented the per-thread object tracking in ObjectStore.
Index: RelNotes-0.8.html
===================================================================
RCS file: /cvsroot/webware/Webware/MiddleKit/Docs/RelNotes-0.8.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** RelNotes-0.8.html 5 Nov 2002 07:44:23 -0000 1.2
--- RelNotes-0.8.html 6 Nov 2002 20:10:34 -0000 1.3
***************
*** 21,28 ****
<a name=Changes><h2>Changes</h2></a>
<ul>
<li> A new 'Database' setting in Settings.config. Set this if the model name isn't the same as the database name.
<li> Also, the database name can be passed via the constructor. See the <a href=UsersGuide.html#MT_DatabaseName>User's Guide</a> for more info.
- </ul>
<p> "Dangling obj refs" now print much more useful information. The old message:
--- 21,49 ----
<a name=Changes><h2>Changes</h2></a>
<ul>
+ <li><p>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).</p>
+ <p>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:
+ <pre>'Threaded': 0,</pre>
+ </p>
+
+ <p>The behaviour of the following methods has changed:
+ <ul>
+ <li>saveChanges() - commits only objects which were modified by the current thread</li>
+ </ul>
+ </p>
+
+ <p>New ObjectStore methods:
+ <ul>
+ <li>hasChangesForCurrentThread() - returns whether the store has any uncommitted changes for the current thread</li>
+ <li><p>saveAllChanges() - commits <b>all</b> 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.</p>
+ <p>When using MiddleKit from WebKit, though, you be calling saveChanges() at the end of any request which modifies MK objects, so I recommend putting <pre>assert not store.hasChangesForCurrentThread()</pre> into your SitePage.sleep() method to catch programming errors early.</p></li>
+ </ul>
+ </p>
+ <p>For <b>upgrading older MiddleKit applications</b>, you'll probably want to replace calls to store.hasChanges() with store.hasChangesForCurrentThread(). Nothing else should need to change.</p>
+ </li>
+
<li> A new 'Database' setting in Settings.config. Set this if the model name isn't the same as the database name.
<li> Also, the database name can be passed via the constructor. See the <a href=UsersGuide.html#MT_DatabaseName>User's Guide</a> for more info.
+ <li>
<p> "Dangling obj refs" now print much more useful information. The old message:
|