[plt-scheme] reloading servlets and modules

From: Paul Graunke (ptg at ccs.neu.edu)
Date: Mon Dec 16 15:15:08 EST 2002

At Mon, 16 Dec 2002 14:53:55 -0500 (EST), Doug Orleans wrote:
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> This issue has been brought up before, e.g.
> http://list.cs.brown.edu/pipermail/plt-scheme/2002-August/000309.html
> but I didn't see any responses.
> I'm starting to develop some servlets, and it's a little tedious to
> have to visit the conf/refresh-servlets URL every time I want to test
> some changes to the servlet.  Is there something I can put in the
> servlet file to prevent the unit from being cached?  I'm guessing
> there's no specific support for this, but I'm wondering if there's
> some trick that I'm not thinking of.  Perhaps a "Refresh" button that
> activated the refresh-servlets link, and then immediately reloaded the 
> servlet page?  (I'd like to avoid Javascript if possible, although
> this is mostly due to ignorance and laziness rather than any
> specific aversion...)

Use the development environment. It avoids the need to use the
refresh-servlets URL.

> Anyway, a similar but different problem is that if I'm developing a
> support module, I have to restart the whole server (in fact the whole
> Scheme process) if I want to make changes to a module.  Perhaps this
> doesn't seem like such a terrible thing: I should be developing on a
> private server, anyway, so if I have some public server that wants to
> keep its session data as long as possible I will only need to restart
> it when installing a new tested version of a module.  Still, it just
> seems draconian to force a reboot in order to upgrade any component--
> this isn't Windows!
> I've tried re`load'ing the module file and requiring the module by
> name, and this usually seems to work, but I'm a little wary of its
> generality.  I guess another thing I could do is write a custom
> module name resolver that doesn't cache modules, or perhaps checks
> file timestamps to determine if a module should be reloaded.
> Is this the right answer?  Has anyone else tried this?
> What exactly is the "variant of `load/use-compiled'" that the
> standard module name resolver uses?
> --dougo at ccs.neu.edu

The server could integrate with modules better.  There are, however,
some trade-offs regarding sharing.  Which modules share namespaces
and which are separated?  There's probably a good way to express this,
but it will require some thought.  In the mean time reloading the
module (and hope the upgrade doesn't break existing code) is probably
your best bet.


Posted on the users mailing list.