Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 91193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:59:30+00:00 2026-05-10T22:59:30+00:00

I have 2 different webapps (package into different war files) which needs to share

  • 0

I have 2 different webapps (package into different war files) which needs to share some data via a cache (ehcache). I want to test out this idea with you to see if it works.

My idea is to create a service that bootstraps/accesses the ehcache and package that inside a jar. Then package that jar into the two wars:

  • WAR1: ehcache-service.jar
  • WAR2: ehcache-service.jar

Would ehcache work in such a configuration ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T22:59:30+00:00Added an answer on May 10, 2026 at 10:59 pm

    You need to create a separate jar(s) with all classes (and all their dependencies) which instances you plan to cache and then deploy this jar as well as ehcache.jar as a library (depending of what application server you use the procedure might be different), in case of Tomcat 6 that means just copy jars to lib folder.

    What happen then is that ehcache and your domain classes will be loaded by the classloader shared by all web applications, so instances will be cached and accessible in memory.

    The dependencies of your domain classes are important, so you should see whether this approach is feasible in your project. It might also affect the way you restart the web applications.


    Furthermore you should be aware that cache and sharing are not necessary the same thing. Cache is an optimization. If you put object instance into cache it might be evicted immediately if, for instance, cache doesn’t have enough storage space or eviction policy configuration. So may be you have to review the way you plan to use ecache in general.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 64k
  • Answers 64k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer The problem you've discovered is that plain UIComponent does not… May 11, 2026 at 10:45 am
  • added an answer Would this regex be better suited to what you need… May 11, 2026 at 10:45 am
  • added an answer If you need to find the size of various sections… May 11, 2026 at 10:45 am

Related Questions

I have 2 different webapps (package into different war files) which needs to share
I have 2-3 different column names that I want to look up in the
I have an if/else statement in the controller and 2 different types of views
I have populated a Datatable, from 2 different servers. I am able to make
This is different than the simple 2 column layout. I need to have this
I have 2 hosts and I would like to point a subdomain on host
I have 2 SQLite databases, one downloaded from a server ( server.db ), and
I have 2 strings that I'd like to compare, and return the positions of
I have 2 time values which have the type datetime.time . I want to
I have 2 arrays of 16 elements (chars) that I need to compare and

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.