Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2016-11-18
20
Medium Priority
?
91 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

609 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