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 493911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:26:57+00:00 2026-05-13T05:26:57+00:00

when using ehcache rather than defining statement like <cache name=testonly.package.model.TestPOJOcategory maxElementsInMemory=200 eternal=true overflowToDisk=false timeToIdleSeconds=300

  • 0

when using ehcache rather than defining statement like

 <cache name="testonly.package.model.TestPOJOcategory"
        maxElementsInMemory="200"
        eternal="true"
        overflowToDisk="false"
        timeToIdleSeconds="300"
        timeToLiveSeconds="600"
    />

can directly define inside entity independent of whatever cache provider we using?

@Cache(
  type=CacheType.SOFT, 
  size=64000 
  expiry=36000000,  
  coordinationType=CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS 
)

reference: http://wiki.eclipse.org/EclipseLink/Examples/JPA/Caching (it only showed for EclipseLink, not ehcache)

  • 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. Editorial Team
    Editorial Team
    2026-05-13T05:26:57+00:00Added an answer on May 13, 2026 at 5:26 am

    First, even if most JPA persistence providers (like Hibernate, EclipseLink,…) provide support for second level cache(s), JPA 1.0 did not specify support of a second level cache. So, when playing with L2 cache, you are actually using JPA extensions which are not standard and are not portable from one provider to another. Hibernate’s @Cache annotation is not the same than EclipseLink’s @Cache annotation and is not comparable with OpenJPA’s @DataCache annotation. All these are different, they are proprietary. If you are using Hibernate (which is my understanding of your previous questions), you shouldn’t look at EclipseLink proprietary things (or for your culture only but this question goes beyond culture if I may).

    Second, what makes you think that EclipseLink’s @Cache annotation has anything to do with EHCache? AFAIK, EclipseLink uses its own cache implementation which is not related to EHCache.

    Actually, I have the feeling that you are a bit lost here. You should maybe slow down a bit and do things step after step: choose one solution, stick with it, identify what you have to do, implements things one by one, and get the whole thing working. Focus on your goal, stop gathering more information for now, take some time to digest the new things you’ve learned.

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

Sidebar

Related Questions

I am using ehCache to store larges amount of data. This cache is accessed
We are using EHCache with CF 8 to cache stuff on a central server
I currently have a distributed cache using EHCache via RMI that works just fine.
When using Hibernate and Ehcache as a second-level cache (2LC) implementation, is (or can)
I'm using ehcache with hibernate and I'd like to use the blocking or SelfPopulating
I am using the EhCache's decorator SelfPopulatingCache and have an issue when the cache
we are using web-ehcache's net.sf.ehcache.constructs.web.filter.SimplePageCachingFilter, that configured by xml, to cache page where is
BAckground: I'm using ehcache as a cache implementation in a Spring 3.1 application. I'm
I'm wondering if it's possible for Hibernate second level cache (we're using EHCache) to
Is there a difference between using Ehcache as Hibernate's second-level cache provider and distributing

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.