Page 1 of 1

AllegroCache object binding

Posted: Mon Apr 22, 2013 7:33 am
by hajovonta
I have an AllegroCache database which I use to persistently store some data:

Code: Select all

(defclass test ()
((id :index :any-unique :reader id)
 (text :accessor text))
(:metaclass persistent-class))
now, consider the following:

Code: Select all

(setf *my-instance* (make-instance 'test :id 0 :text "Blabla"))
this binds the newly created instance to *my-instance*. I have the following problem: if I write this:

Code: Select all

(make-instance 'test :id 0 :text "Blabla")
then the instance gets stored in AllegroCache database, but I have no binding to use it. If I restart the machine, I will have to reload the program and bind the instances to some variables afterwards somehow; but I can't figure out a good way to do this.

I have made attempts to bind with doclass, but without success.