On Sep 21, 2006, at 10:51 AM, Wolfgang Keller wrote:

>> mike wrote:
>> if someone wants to write an extension, most easily to
>> sessioncontext, that just synchronizes data between open sessions,
>> thats not a big deal.  But it really is somewhat of a reinvention of
>> the database itself.  the Session only represents the set of objects
>> youre working on *right now*.  if i wrote a function that loaded a
>> row from a database, and then i was going to operate on some of those
>> values, would i want those values to magically change while i was in
>> the middle of my operation ?
>
> Err, no. However I do think that you should be notified that they  
> have been
> changed by some third-party and then have the possibility to update  
> your
> values if you want to.
>

ok, and what sort of mechanism would be used for this notification ?   
if im inside of a python function, would there be some kind of  
interrupt mechanism being used, that yanks me out of my current code  
into some subroutine to deal with a change ?  or would it be the job  
of the code itself to finish what its doing, and then before doing  
the next thing simply check for changes ?  all this requires in the  
session-based model is to expire() all the objects contained within  
(or just clear it out, or get your objects using load(), etc.  the  
session has many ways of going back to the database to get the latest  
data).  the database then acts as the commonality between all open  
sessions.  this is why building another layer of commonality between  
sessions in python is somewhat of a reinvention of the wheel; you can  
argue that its faster or more efficient than going back to the  
database, in which case its an optimization; but i wouldnt optimize  
and complicate before determining that the database itself is not  
fast enough.

at this point, id like to see what you want your code to look like  
for your application to do what it needs.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to