AllegroCache object binding

Discussion of Common Lisp

AllegroCache object binding

Postby 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"))

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.
Posts: 17
Joined: Wed Aug 24, 2011 12:42 am

Return to Common Lisp

Who is online

Users browsing this forum: andrei-n, Bing [Bot], Yahoo [Bot] and 2 guests