• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 103
  • Last Modified:

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

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
sidwelle
Asked:
sidwelle
  • 10
  • 8
1 Solution
 
CEHJCommented:
The system properties are found in the jvm itself. They are not persisted. So you would need another mechanism
0
 
sidwelleAuthor Commented:
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
 
CEHJCommented:
When i say 'not persisted',  i really mean that they are not a persistence mechanism.
Tell us more about your goal
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
sidwelleAuthor Commented:
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
 
CEHJCommented:
'Javascript'? That has nothing to do with Java System properties
0
 
sidwelleAuthor Commented:
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
 
CEHJCommented:
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
 
sidwelleAuthor Commented:
Can you suggest another place ?
0
 
sidwelleAuthor Commented:
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
 
CEHJCommented:
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
 
sidwelleAuthor Commented:
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
 
CEHJCommented:
Surely you would only write it when the value changed from the previous one?
0
 
sidwelleAuthor Commented:
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
 
CEHJCommented:
Very difficult to comment constructively without knowing the specifics of what you're doing
0
 
sidwelleAuthor Commented:
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
 
CEHJCommented:
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
 
sidwelleAuthor Commented:
I accept what you are stating, I will just have to look somewhere else to try and persist some values.

Thanks
0
 
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
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
 
sidwelleAuthor Commented:
I am not in a browser !
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

  • 10
  • 8
Tackle projects and never again get stuck behind a technical roadblock.
Join Now