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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:15:37+00:00 2026-06-13T06:15:37+00:00

We are planning to use some caching mechanism in our application, and chosen Java

  • 0

We are planning to use some caching mechanism in our application, and chosen Java Caching System(JCS) after performing comparison study among many other caching solutions. Every thing is fine when I use external configuration (cache.ccf) to define cache regions and its properties( like maxlife, ideltime, etc).

But the requirement is changed to have dynamic cache regions, that is we would need to define cache regions and its properties at run time. I am not able to find more details or samples regarding this operation.
I successfully created cache regions at run time ( using below method signature).

ICompositeCacheAttributes  cattr=..
IElementAttributes attr = new ElementAttributes();
attr.setIsEternal(false);
attr.setMaxLifeSeconds( maxLife );    
defineRegion(name,  cattr,attr);

But the problem is, IElmentAttributes does not sets to the cache. I did research on source of JCS and found attr is never set. It is non used argument!! bit strange

After some more googling, I found below options to set the attributes manually, but still did not work

 IElementAttributes attr = new ElementAttributes();
 attr.setIsEternal(false);
 attr.setMaxLifeSeconds( maxLife );
 jcs.setDefaultElementAttributes(attr);

All I want is to set maxLifeSeconds for created regions.

  • 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-06-13T06:15:38+00:00Added an answer on June 13, 2026 at 6:15 am

    I found way through for my problem, we need to set attributes when you put the data in to cache. See the implementation for somebody who is interested,

    JCS jcs = JCS.getInstance("REGION");
    IElementAttributes attr = new ElementAttributes();
    attr.setIsEternal(false);
    attr.setMaxLifeSeconds( maxLife );
    jcs.put("Key",data, attr);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are planning to use HTML 5 's Application cache in our application for
We are planning to build an IPhone application which will use some of the
I was planning to use url routing for a Web Forms application. But, after
I am planning to use EJBContext to pass some properties around from the application
I am planning to use SCTP for a embedded Linux project. Anybody has some
I'm planning to use some session variables on an intranet ASP/VB.NET page, and want
I am planning to use Maxmind's DAT file to provide some basic geolocation capabilities
Was planning to use Service Routing (on WCF/REST) to do some common tasks before
I am in the planning stage of a moderately big application -- and after
I am planning to use jQuery in my new website. I have some questions

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.