What you talk about is the latest snapshot of a Temporal Database. It might be interesting to see how to implement a temporal database using SA ORM over a normal RDBMS. Could be a successful niche. :)
However, simply keep a modification time column and keep all records on the server even if they were deleted. then sync by selecting all the changes since the modification time you have on the client. You can enhance that by keeping a modification time for each data column or one column that contains a list of modification times for each column. Then, you tell the server that i have xx-xx-xx xx:xx:xx version of the data and it send you a list of rowIDs and their columnIDs that changed. You then select all the rows on your client side and strip the non-relevant columns. Pickle and send. You can even enhance on that by sending only the data using a package from the twisted communication library called jelly which only encodes the attributes and not all the object like pickle to save bandwidth. On the other side the result will be just like unpickling. However, note that all this hassle might not be necessary if the data itself in the rows is not very large to justify stripping unchanged columns. On Thursday 13 July 2006 00:31, Steve Zatz wrote: > Thanks for all the comments. Let me be a little more clear. > > The synchronization does not take place in real-time. Users with > laptops with no Internet access make a few changes to their local copy > of the database. When they get an Internet connection they manually > indicate that they want to synchronize their local copy of the > database with the server version, which can also be accessed directly > when people have Internet access. The local laptops and the server > exchange rows marked as "dirty" via exchanging pickled SA objects > without knowing what column(s) in the objects are changed. There is a > pretty simple system to handle conflicts when the same server and > local row is marked as "dirty." Michael answered my question that > there is no API that I missed that allows you to simply mark some or > all attributes of an SA row object as dirty therefore writing to the > database when you flush the session. That is really what I was > looking for but since the current method of just reading one object's > attributes and setting the corresponding object's attributes works > given the low volume of data transferred, I can keep doing that. > Again, thanks for everyone's thoughts on this. > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Sqlalchemy-users mailing list > Sqlalchemy-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users -- Regards, Tzahi. -- Tzahi Fadida Blog: http://tzahi.blogsite.org | Home Site: http://tzahi.webhop.info WARNING TO SPAMMERS: see at http://members.lycos.co.uk/my2nis/spamwarning.html ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Sqlalchemy-users mailing list Sqlalchemy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users