Skip to content

JSPWIKI-1371 Give each caching manager its own Ehcache cache manager - #642

Open
arturobernalg wants to merge 1 commit into
apache:masterfrom
arturobernalg:fix-1371-cache-per-engine
Open

arturobernalg wants to merge 1 commit into
apache:masterfrom
arturobernalg:fix-1371-cache-per-engine

Conversation

@arturobernalg

Copy link
Copy Markdown
Member

The caching manager used the CacheManager singleton of Ehcache, so every engine of the same class loader shared the caches of the others, and shutting down one engine shut them down for all.

A page saved by an engine that is still running, like the one in ImageTest, showed up in the search results of another engine. This is what made SearchManagerTest and PageRenamerTest fail at random (JSPWIKI-1371). I reproduced it: a second engine listed the pages of the first one.

Each caching manager now creates and shuts down a cache manager of its own.

A new test in EhcacheCachingManagerTest fails without the change (expected null but was the content of the other manager) and passes with it. The test suites of jspwiki-cache and jspwiki-main pass (1169 tests in jspwiki-main).

The caching manager used the CacheManager singleton of Ehcache, so every engine of the same class loader shared the caches of the others, and shutting down one engine shut them down for all. A page saved by an engine that is still running, like the one in ImageTest, showed up in the search results of another engine, and this made SearchManagerTest and PageRenamerTest fail at random. Each caching manager now creates and shuts down a cache manager of its own.
@spyhunter99

spyhunter99 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

i'm not convinced this will fix the issue with the portable build due to the classloading issue.
In reality, we should make the portable build just be two independent copies of jspwiki. the deployment technique in the portable is very out of the ordinary and against all the standard deployment mechanisms just to save some bytes on disk

edit: just saw the other PR. this one is fine too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants