[Sqlalchemy-commits] [1246] sqlalchemy/trunk/doc/build/content/unitofwork.myt: still tryin to clarif
Brought to you by:
zzzeek
From: <co...@sq...> - 2006-04-03 05:50:43
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><style type="text/css"><!-- #msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; } #msg dt { float: left; width: 6em; font-weight: bold; } #msg dt:after { content:':';} #msg dl, #msg dt, #msg ul, #msg li { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; } #msg dl a { font-weight: bold} #msg dl a:link { color:#fc3; } #msg dl a:active { color:#ff0; } #msg dl a:visited { color:#cc6; } h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; } #msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; } #msg ul, pre { overflow: auto; } #patch { width: 100%; } #patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;} #patch .propset h4, #patch .binary h4 {margin:0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;} #patch .propset .diff, #patch .binary .diff {padding:10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, .info {color:#888;background:#fff;} --></style> <title>[1246] sqlalchemy/trunk/doc/build/content/unitofwork.myt: still tryin to clarify....</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>1246</dd> <dt>Author</dt> <dd>zzzeek</dd> <dt>Date</dt> <dd>2006-04-03 00:50:34 -0500 (Mon, 03 Apr 2006)</dd> </dl> <h3>Log Message</h3> <pre>still tryin to clarify....</pre> <h3>Modified Paths</h3> <ul> <li><a href="#sqlalchemytrunkdocbuildcontentunitofworkmyt">sqlalchemy/trunk/doc/build/content/unitofwork.myt</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="sqlalchemytrunkdocbuildcontentunitofworkmyt"></a> <div class="modfile"><h4>Modified: sqlalchemy/trunk/doc/build/content/unitofwork.myt (1245 => 1246)</h4> <pre class="diff"><span> <span class="info">--- sqlalchemy/trunk/doc/build/content/unitofwork.myt 2006-04-03 05:22:42 UTC (rev 1245) +++ sqlalchemy/trunk/doc/build/content/unitofwork.myt 2006-04-03 05:50:34 UTC (rev 1246) </span><span class="lines">@@ -200,7 +200,10 @@ </span><span class="cx"> <p>This second form of commit should be used more carefully as it will not necessarily locate other dependent objects within the session, whose database representation may have foreign constraint relationships with the objects being operated upon.</p> </span><span class="cx"> </span><span class="cx"> <&|doclib.myt:item, name="whatis", description="What Commit is, and Isn't" &> </span><del>- <p>The purpose of the Commit operation is to instruct the Unit of Work to analyze its lists of modified objects, assemble them into a dependency graph, fire off the appopriate INSERT, UPDATE, and DELETE statements via the mappers related to those objects, and to synchronize column-based object attributes that correspond directly to updated/inserted database columns. <b>And thats it.</b> It does not affect any <code>relation</code>-based object attributes, that is attributes that reference other objects or lists of other objects, in any way. A brief list of what will <b>not</b> happen includes:</p> </del><ins>+ <p>The purpose of the Commit operation, as defined by the <code>objectstore</code> package, is to instruct the Unit of Work to analyze its lists of modified objects, assemble them into a dependency graph, fire off the appopriate INSERT, UPDATE, and DELETE statements via the mappers related to those objects, and to synchronize column-based object attributes that correspond directly to updated/inserted database columns.</p> + <p>Its important to note that the <b>objectstore.get_session().commit() operation is not the same as the commit() operation on SQLEngine.</b> A <code>SQLEngine</code>, described in <&formatting.myt:link, path="database"&>, has its own <code>begin</code> and <code>commit</code> statements which deal directly with transactions opened on DBAPI connections. While the <code>session.commit()</code> makes use of these calls in order to issue its own SQL within a database transaction, it is only dealing with "committing" its own in-memory changes and only has an indirect relationship with database connection objects. + </p> + <p>The <code>session.commit()</code> operation also does not affect any <code>relation</code>-based object attributes, that is attributes that reference other objects or lists of other objects, in any way. A brief list of what will <b>not</b> happen includes:</p> </ins><span class="cx"> <ul> </span><span class="cx"> <li>It will not append or delete any object instances to/from any list-based object attributes. Any objects that have been created or marked as deleted will be updated as such in the database, but if a newly deleted object instance is still attached to a parent object's list, the object itself will remain in that list.</li> </span><span class="cx"> <li>It will not set or remove any scalar references to other objects, even if the corresponding database identifier columns have been committed.</li> </span></span></pre> </div> </div> </body> </html> |