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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:35:40+00:00 2026-06-14T22:35:40+00:00

I’m developing a webapplication using Java EE with JPA. Now I’ve come across a

  • 0

I’m developing a webapplication using Java EE with JPA. Now I’ve come across a few values that I need saved for one instance. E.g.: name of the webapplication, taxnumber, contact data. Some of these values can be changed by the CMS.

What would be an efficient way to save these data?

  • Entity object: I don’t feel right by making an object for this, saving it as an Entity. This way it would create a table with only one entry. I would need to make a DAO to access it too.
  • Properties file: I don’t want to lose any changes after running a new version of my WAR. Secondly I think there might be a better solution than editing properties files.
  • Applicationscoped bean: I don’t want my data to be lost upon restarting the application for whatever reason.

Is there another more efficient way to handle values like these? Or should I use one of these ways, if so, why?

Thanks for your input!

  • 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-14T22:35:42+00:00Added an answer on June 14, 2026 at 10:35 pm

    I’m not sure of enough of the specifics of your application to be able to say for certain which will be best, but my thoughts on when to use what type of setting storage is:

    • Database (settings table) – really thrives where you will have values that will be changed independently of what happens with your source, the values are environment specific, or people who you don’t want mucking around on your file system will be changing the values (ex. whether a feature is enabled on the environment, which server to talk to for some type of request)
    • Properties file – good for when you have data that will be set on a per machine basis in you cluster (although I would suggest standardizing everything in your cluster), or when your CMS will be the primary (only?) way of setting the properties and you will be replacing the file with each install
    • Application bean – The setting is needed at application startup (ex. the number beans to spin up, or the database connection string)
    • In code – The value will never be changed… ever (ex. application name)

    The most efficient way to store a setting will be in code directly, but it is so inflexible that it isn’t worth it in most cases. Storing the property on the file system as opposed to in the database will be about the same assuming you have caching for your database and are reading it from the database every time you get the property. If you don’t have caching then you will be paying the price of a disk read every time you access the property where as a property file will store the value in memory after it is read.

    For ease of changing the value, I believe that storing it in the database is the easiest way to change it (assuming you aren’t changing it across a lot of different environment frequently) because you can change it while the application is live and have it take effect quickly. If you have the property in a file on the file system you either need a way to force your application to re-read the property while it is running, or you will have to bounce your application to change the property. If you have it in code you have to respin your build to effect the property (obviously).

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

Sidebar

Related Questions

I have thousands of HTML files to process using Groovy/Java and I need to
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need a function that will clean a strings' special characters. I do NOT
I'm making a simple page using Google Maps API 3. My first. One marker
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have been unable to fix a problem with Java Unicode and encoding. The

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.