I'm trying to write my first web application using weblocks slowly
trying to break the ice with this magical framework.
I'm really a common lisp newbie, so sorry if my questions are too lame
:-)
Trying to learn from the examples, I'm often bitten from strange
problems regarding the persistence layer.
In particular, I loaded the simple-blog demo, the weblocks-elephant-demo
and an home made webapp which uses also the elephant persistence layer.
When I run these webapps isolated, all works like a charm, but when
starting them together it seems that they end up using the same
persistence store, instead of using the stores defined in their own
package.
I'm using weblocks-stable with sbcl 1.0.26.1 from clbuild with cffi and
uffi installed through asdf-install to make the elephant layer works.
So, my question is: how can I use multiple elephant storage in my
weblocks applications?
Any help would be much appreciated.
TIA,
Andrea.
--
Reclama i tuoi diritti digitali, elimina il DRM. Approfondisci su
http://www.no1984.org
Reclaim your digital rights, eliminate DRM. Learn more at
http://www.defectivebydesign.org/what_is_drm
> However, after you wrap up store accesses in webapp specific
> functions, then you shouldn't have to think about this much. This
> macro might be helpful.
[...]
>
> Ian
Thank you very much for these suggestions. Changing name of the store
variables didn't worked out, so I'll try with your approach.
Thanks again,
I've tried that but it seems that, at least with the elephant store,
different webapps ends up using the same store.
Many thanks for your help,
It is easiest to do this with an :around-method on
handle-client-request. Search the group for my past messages on this
(with regard to CLSQL).
--
Sorry but you say Nibiru is a Hoax? Doesnt Exist? So maybe The
Sumerian people doesnt exist also! --Anonymous by way of SkI
Unfortunately, this post lies at the same level as that post, so if/when
it comes up again, whoever asks will have to search again, or someone
will make a post like the one to which I reply...
It would not behoove us to document the ability to create around-methods
for this purpose in the HCR docstring; this is implicit in CLOS. It is
a mere matter of mentally adding this CLOS feature with that knowledge
of the (documented) Weblocks API.
> It would not behoove us to document the ability to create around-methods
> for this purpose in the HCR docstring; this is implicit in CLOS. It is
> a mere matter of mentally adding this CLOS feature with that knowledge
> of the (documented) Weblocks API.
I usually hint at that possibility in docstrings by writing
"Create an :AROUND method for METHOD in order to ..."
> It is easiest to do this with an :around-method on
> handle-client-request. Search the group for my past messages on this
> (with regard to CLSQL).
This works great, thanks.
(in-package a)
(defwebapp app-a)
(defstore *store-a*)
(in-package b)
(defwebapp app-b)
(defstore *store-b*)
When an app-a request is running, *default-store*=*store-a*, and similar
for app-b requests with *store-b*. More details in `*default-store*'
docstring and new defwebapp :default-store initarg.