Ticket #4 (closed defect: wontfix)

Opened 6 months ago

Last modified 6 months ago

Module caching not working

Reported by: robert Assigned to: hannes@helma.at
Priority: major Milestone: Helma NG 0.3
Component: helma-ng Version:
Keywords: Cc:

Description

It seems that the caching of modules in RhinoEngine is broken (at least in the shell). When importing a module multiple times it is always loaded in loadModule(), the check in line 342 always returns false because the "modules" HashMap stays empty, in fact it's recreated in onContextCreated() every time importModule() is executed.

Change History

06/02/08 10:29:36 changed by hannes

  • status changed from new to closed.
  • resolution set to wontfix.

That's actually intentional. Modules are reloaded unless they have __shared__ = true in their top scope. The code you link is actually to avoid loading modules multiple times within one request. If we enable this for the shell, editing and re-importing a module would actually do nothing, which would be quite disadvantageous. So if you want shared/cached modules, you really have to use __shared__ (also within the web framework).