Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between ehcache and ehcache-core

I am beginner for ehcache v/s ehcache-core in Spring framework, my pom.xml used ehcache version 1.5.0

<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>1.5.0</version>
</dependency>

Now, it will need to update ehcache version because it will use in another jar:- Updated ehcache version 2.7.0 But it returns error net.sf.ehcache.Cache.getStatistics() method not found.

Now, I am replacing ehcache via ehcache-core 2.5.7 as:-

<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-core</artifactId>
<version>2.5.7</version>
</dependency>

Is it break another functionalities or will work same as ehcache?

like image 434
user2317982 Avatar asked Jul 03 '13 09:07

user2317982


People also ask

What is Ehcache used for?

Ehcache is an open source, standards-based cache that boosts performance, offloads your database, and simplifies scalability. It's the most widely-used Java-based cache because it's robust, proven, full-featured, and integrates with other popular libraries and frameworks.

What is Net SF Ehcache?

Ehcache is an open source, standards-based cache used to boost performance, offload the database and simplify scalability. Ehcache is robust, proven and full-featured and this has made it the most widely-used Java-based cache. Licenses. The Apache Software License, Version 2.0.

How to disable Ehcache?

sf. ehcache. disabled=true in the Java command line) disables caching in ehcache. If disabled, no elements can be added to a cache (puts are silently discarded).

What is Ehcache XML?

XML Configuration. BigMemory Max uses Ehcache as its user-facing interface and is configured using the Ehcache configuration system. By default, Ehcache looks for an ASCII or UTF8 encoded XML configuration file called ehcache. xml at the top level of the Java classpath.


1 Answers

Just as many other large frameworks (like Spring), ehcache is split into several modules. One of those modules is core, the others are web, server, jcache, debugger and many more (see https://mvnrepository.com/artifact/org.ehcache.modules).

Sometimes, for various reasons, you may not want to include the entire large framework, with all its sublibraries, into your project. Then you can decide which module you want to use.

In other words, using ehcache pom will include a full library in your project. Using ehcache-core will only include functionalities defined in ehcache-core.

You can either find out which module contains the functionality you need and include it, or go with full ehcache but use the appropriate version.

like image 169
Dariusz Avatar answered Sep 20 '22 17:09

Dariusz