cPython, IronPython, Jython, and PyPy (Oh my!)

Adam Tauno Williams awilliam at whitemice.org
Sat May 19 09:31:32 EDT 2012


On Thu, 2012-05-17 at 11:13 +1000, Chris Angelico wrote: 
> On Thu, May 17, 2012 at 9:01 AM, Ethan Furman <ethan at stoneleaf.us> wrote:
> > A record is an interesting critter -- it is given life either from the user
> > or from the disk-bound data;  its fields can then change, but those changes
> > are not reflected on disk until .write_record() is called;  I do this
> > because I am frequently moving data from one table to another, making
> > changes to the old record contents before creating the new record with the
> > changes -- since I do not call .write_record() on the old record those
> > changes do not get backed up to disk.
> I strongly recommend being more explicit about usage and when it gets
> written and re-read, 

You need to define a 'session' that tracks records and manages flushing.
Potentially it can hold a pool of weak references to record objects that
have been read from disk.  Record what records are 'dirty' and flush
those to disk explicitly or drop all records ('essentially rollback').
That is the only sane way to manage this.

> rather than relying on garbage collection.

+1 +1 Do *not* rely on implementation details as features.  Sooner or
later doing so will always blow-up.

> Databasing should not be tied to a language's garbage collection.
> Imagine you were to reimplement the equivalent logic in some other
> language - could you describe it clearly? If so, then that's your
> algorithm. If not, you have a problem.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://mail.python.org/pipermail/python-list/attachments/20120519/d82572e1/attachment.sig>


More information about the Python-list mailing list