?
Solved

what is a "java.lang.System Property"   ?

Posted on 2016-11-18
20
Medium Priority
?
88 Views
Last Modified: 2016-12-01
What is a Java system property and where is it stored ?
I need someplace to persist values that are not on the drive, and wanted to know if saving values to the system properties is acceptable ?

Is there any type of size limit ?

Thank you.
0
Comment
Question by:sidwelle
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 10
  • 8
20 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 41893630
The system properties are found in the jvm itself. They are not persisted. So you would need another mechanism
0
 

Author Comment

by:sidwelle
ID: 41893648
Not persisted:  I find that each time I go back chk the value its still there.
Not persisted across "reboots" ? or environment stops and starts ?
 
That's why I ask where they are stored ?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 41893654
When i say 'not persisted',  i really mean that they are not a persistence mechanism.
Tell us more about your goal
0
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 

Author Comment

by:sidwelle
ID: 41893665
I have a table that I am loading from a file and I don't want to load it each time the JavaScript is called.
I was trying to find some mechanism that I could use to store a string value.

Only retrieve the table is the table value was empty or the date of the table in memory and date on the file don't match.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 41893670
'Javascript'? That has nothing to do with Java System properties
0
 

Author Comment

by:sidwelle
ID: 41893717
I am using a product where the authors have made JavaScript available as a utility to manipulate values.
We are calling Java objects from JavaScript, sorry if its confusing.

Is the System Properties a suitable place to store values ?
Is there anther mechanism w/in Java to store and retrieve values ?

Thanks
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 41893729
Is the System Properties a suitable place to store values ?
In a word, no. The system decides what goes in there and anyway it's not a persistence mechanism really. It's really environment variables for Java
0
 

Author Comment

by:sidwelle
ID: 41893738
Can you suggest another place ?
0
 

Author Comment

by:sidwelle
ID: 41893764
If I have a server that up for Months at a time, and I need a place to store sting values, how is different from an environment variable found in the O.S.  ?  It serves as a place for the apps to store values about the environment.  How is this different from a property bag that a ActiveX control would keep.  only difference is that I have to repopulate after a reboot ?
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 41893796
Any persistent variable resides on disk. In the case of Windows, in the registry. In the case of Unix in scripts that are sourced on startup. So if you want to persist something, it will have to be some disk somewhere
0
 

Author Comment

by:sidwelle
ID: 41894279
The Javascripts are stateless with no native way to store values, so I was looking some place to store values between script calls.  The scripts are called several times a minute, so I did not want to create script that would thrash the disk by calling it several times a minute 24x7.

Would it be possible to write to a memory location that live between scripts executions and not write to the disk ?

Thank you.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 41894313
Surely you would only write it when the value changed from the previous one?
0
 

Author Comment

by:sidwelle
ID: 41894345
Yes, but then I have to read the whole file and parse for the value that I want.
Didn't want to do that several times a minute.

Be a lot nicer if I have place to stick in memory and then only read the file if the value was empty or outside of hardcoded tolerances.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 41894368
Very difficult to comment constructively without knowing the specifics of what you're doing
0
 

Author Comment

by:sidwelle
ID: 41894477
Simply trying to make this product do more than it was intended.

Probably the same reason that cookies were invented for the browser, I just need somewhere to store some values and I was trying to avoid using the drive.
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 1500 total points
ID: 41894694
Well cookies, which you may not be able to use anyway if  you're running client-side scripts, also work by writing to the drive
0
 

Author Closing Comment

by:sidwelle
ID: 41909110
I accept what you are stating, I will just have to look somewhere else to try and persist some values.

Thanks
0
 
LVL 23

Expert Comment

by:Siva Prasanna Kumar
ID: 41909130
If you were using Javascript, you could have tried using Local storage of HTML 5, check: https://developer.mozilla.org/en/docs/Web/API/Window/localStorage
0
 

Author Comment

by:sidwelle
ID: 41909520
I am not in a browser !
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses
Course of the Month13 days, 5 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question