[Bioperl-l] bioperl-db: small change to create() instruction flow
Hilmar Lapp
hlapp at gnf.org
Tue May 27 22:22:56 EDT 2003
Ignore this if you a) don't use bioperl-db, or b) don't care about nor
rely on its inner workings.
OK, here goes. I made a change to the workflow in create() in the
bioperl-db adaptors: if the adaptor looks up the object by unique key
before attempting an insert (it does so if in caching mode) and it
finds it, it will set the primary key of the object passed to the
adaptor to the primary key of the object found and then return the
passed object.
The change is that after setting the primary key, it no longer cascades
down to storing all children.
This was a question I had punted on before. The rationale why I removed
the cascade here is that it is inconsistent treatment: storing children
potentially updates them, whereas the object itself is not updated if
it is found by lookup.
Note that if the object is INSERTed, the insert operation will still
cascade to the children.
The change gets rid of excessive updates and look-ups when loading
terms and term relationships (terms are cached). I'm reporting this
change here in case someone relied on it, but I doubt anyone does ...
-hilmar
--
-------------------------------------------------------------
Hilmar Lapp email: lapp at gnf.org
GNF, San Diego, Ca. 92121 phone: +1-858-812-1757
-------------------------------------------------------------
More information about the Bioperl-l
mailing list