SBCL save-lisp-and-die vs defstore

101 views
Skip to first unread message

Rafael Jesús Alcántara Pérez

unread,
Oct 6, 2010, 3:41:59 PM10/6/10
to weblocks
Hi:

We are trying to make an image of a weblocks application. When we
"restart" the image, we define the store (a perec store we are
developing) with the proper configuration in the target machine. This
is when the problem appears; the macro defstore tries to load weblocks-
store (even when it is already loaded before saving the image) and all
its dependencies (not few). Is there an elegant solution for that
problem?

Thanks in advance.

Nandan Bagchee

unread,
Oct 7, 2010, 1:00:02 AM10/7/10
to webl...@googlegroups.com
I've experimented with images mostly because they load really fast. But in my case the store is loaded only when weblocks is started (I saved the image *without* starting weblocks). The big caveat is that I am on weblocks 0.8.2 or so -- I will have to experiment with the latest weblocks before I can say definitively that the same procedure works.

Can you post exactly where your defstore form occurs? And the toplevel that you run when the core is loaded?

Perhaps try saving the image without having started weblocks? 


2010/10/7 Rafael Jesús Alcántara Pérez <rafaelalca...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "weblocks" group.
To post to this group, send email to webl...@googlegroups.com.
To unsubscribe from this group, send email to weblocks+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/weblocks?hl=en.


Rafael Jesús Alcántara Pérez

unread,
Oct 7, 2010, 2:46:46 AM10/7/10
to webl...@googlegroups.com
On Jueves 07 Octubre 2010 07:00:02 Nandan Bagchee escribió:
> I've experimented with images mostly because they load really fast. But in
> my case the store is loaded only when weblocks is started (I saved the image
> *without* starting weblocks). The big caveat is that I am on weblocks 0.8.2
> or so -- I will have to experiment with the latest weblocks before I can say
> definitively that the same procedure works.
>
We do the same, weblocks is started only when the store is defined (after restarting the image).

> Can you post exactly where your defstore form occurs? And the toplevel that
> you run when the core is loaded?
>

(defun resume-from-save-lisp-and-die ()
(initialize-environment)
(start-skynet.web))

(defun initialize-environment (&key developmentp)
(skynet.consola::load-configuration)
(if (not developmentp)
(progn
(disable-sql-log)
(setf weblocks:*catch-errors-p* t))
(progn
(enable-sql-log)
(setf weblocks:*catch-errors-p* nil)
(when (probe-file *local-config-file*)
(load *local-config-file*))))
(defstore *perec-store* :perec
`(:host ,skynet.bd:*skynet-database-host*
:database ,skynet.bd:*skynet-database-name*
:user-name ,skynet.bd:*skynet-database-user*
:password ,skynet.bd:*skynet-database-password*)))

(defun start-skynet.web (&rest args)
"Starts the application by calling `start-weblocks' with appropriate
arguments."
(apply #'start-weblocks args)
(setf *database* weblocks:*default-store*)
(start-webapp 'skynet.web-root :public-files-path *public-files-path*))

> Perhaps try saving the image without having started weblocks?
>

That's what we have done :)

Greets.
Rafael J. Alcántara Pérez.
--

Rafael Jesús Alcántara Pérez

unread,
Oct 8, 2010, 9:31:40 AM10/8/10
to weblocks
I have found a not very beautiful solution by making a new macro
called "defstore*" that does not execute "%defstore-postdefine".
Now, when the sbcl image is started again, it does not try to load the
store package.

Brit

unread,
Oct 15, 2010, 3:57:56 PM10/15/10
to weblocks
Rafael,

I'm excited to hear that you're working on a CL-Perec backend for
weblocks. Can you say whether there are plans to get it upstream? Will
it allow the programmer to specify the DB schema rather than say
Elephant's style of doing it for you?

Regards,
Brit Butler

On Oct 8, 9:31 am, Rafael Jesús Alcántara Pérez

Rafael Jesús Alcántara Pérez

unread,
Oct 15, 2010, 6:45:59 PM10/15/10
to weblocks, Francisco Vides Fernández
Hi Brit:

On 15 oct, 21:57, Brit <redline6...@gmail.com> wrote:
> Rafael,
>
> I'm excited to hear that you're working on a CL-Perec backend for
> weblocks. Can you say whether there are plans to get it upstream?
Currently I'm testing it, and it only supports now the postgresql
backend (because of my laziness :)
Now it is packaged alone and I don't know if there is any interest in
including it in weblocks.

> Will it allow the programmer to specify the DB schema rather than say
> Elephant's style of doing it for you?
>
Sorry but I don't understand the question. If you refer to store
declaration, this is an example:

(defstore* *perec-store* :perec
'(:host "localhost" :database "mydb" :user-name "myuser" :password
"mypassword"))
Reply all
Reply to author
Forward
0 new messages