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

  • SEARCH
  • Home
  • 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 691273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:31:28+00:00 2026-05-14T02:31:28+00:00

I have been developing a project and in this project i have designed my

  • 0

I have been developing a project and in this project i have designed my code to do the same job after a specified time interval continuously. The job that wanted to be done has a lot of distinct cycles. The interval is small to execute them normally thus i used threads. Until that point everything is clear for me.

To decrease the process and information transaction i wanted to put an session like object that holds the given data and provide it to any thread at anytime. With this object i plan to not query the same configuration information from database at everytime but if it exists on the session take it else query and store on session.

I’m not sure how to implement this structure.

Regards,

  • 1 1 Answer
  • 1 View
  • 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-14T02:31:28+00:00Added an answer on May 14, 2026 at 2:31 am

    That depends. There are several ways to keep and pass information in Java.

    1. Applicationwide: declare it static and/or load it in a static {}.
    2. Threadlocal: make use of ThreadLocal<T>.
    3. Objects: put data in wrapper objects (javabeans?) which you just create once and pass around as c’tor/method arguments.

    In your case I think either 1 or 3 is applicable. A real “session” is usually threadlocal, but your functional requirement (“provide to any thread at anytime”, “configuration information”) makes me think you’re rather looking for an applicationwide constant.

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

Sidebar

Related Questions

I am developing a project that lately have been taking off with increased popularity.
I have been developing a WCF project that will expose web services (HTTP-based) that
I have a plugin project I've been developing for a few years where the
I have been developing in asp.net since its existence (also classic asp before that)
I have been developing a project in python for the last six months, and
I have a project (Web Application) which I have been developing in C#/ASP.NET, and
I have a Pyramid app that I've been developing and viewing locally through http://localhost:6543
I have been developing (for the last 3 hours) a small project I'm doing
I have been stuck at this for a while. I have been developing a
I'm currently open sourcing a project that we've been developing on our own personal,

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.