[elephant-devel] unique object IDs and OIDs

Alex Mizrahi killerstorm at newmail.ru
Fri Nov 14 22:29:06 UTC 2008


 PE> I'm wondering if it is appropriate to use the OIDs that elephant
 PE> assigns objects for this purpose.

yep, i think it's fine

 PE>  Will these values change during the lifetime of the associated object?

they shouldn't.

oids are not preserved across export/import operations (by design of these
export/import operations), but typically it's not a problem.

 PE> If using OID values makes sense for this purpose, is there a user-API
 PE> way to get an object by its OID?

yep, via class index:

(get-value oid (find-class-index 'classname))

an internal function get-cached-instance does it in more straightforward
way, though.

 PE>  Should I instead add another indexed field on my object that contains
 PE> the OID value?

definitely not, unless you want to use your own ids.







More information about the elephant-devel mailing list