Next: , Previous: Store Controller API, Up: User API Reference


5.2 Persistent Objects

Class elephant:persistent-metaclass can be used as the :metaclass argument in a defclass form to create a persistent object. Slots of the metaclass take the :index and :transient keyword arguments and the class accepts the :index keyword argument.

— Macro: elephant:defpclass cname parents slot-defs &rest class-opts

Shorthand for defining persistent objects. Wraps the main class definition with persistent-metaclass

— Generic Function: elephant:drop-instance persistent-object

drop-instance reclaims persistent object storage by unbinding all persistent slot values. It can also helps catch errors where an object should be unreachable, but a reference still exists elsewhere in the db. On access, the unbound slots should flag an error in the application program. important: this function does not clear any serialized references still in the db. Need a migration or gc for that! drop-instances is the user-facing call as it implements the proper behavior for indexed classes