AllegroCache object binding

Discussion of Common Lisp
Post Reply
hajovonta
Posts: 17
Joined: Wed Aug 24, 2011 12:42 am

AllegroCache object binding

Post by hajovonta » Mon Apr 22, 2013 7:33 am

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"))
(commit)
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")
(commit)
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.

Post Reply