posted 23 years ago
Hi,
Working on a code where I will provide a class to read/update some attributes.
Options with me are:
Store in DB
Store in Property File
Store in an Interface.
I decided to go for the Property File.
I thought I will make a singleton class and will read the attributes during the loading of class. Because there will be a silgle instance every call (read or update) will go through it.
Everything going fine. But hey!! In distributed env where we can have more then more then one JVM, how this is going to work.
Is there any work around?
Then I thought, drop the idea of singleton class, I will read the attributes from the property file and everytime somebody trys to read a attribute, I'll check the timestamp of the file. If it is different from the previous one, Update the properties.
Is this the right approach? Isn't this going to be performance overhead. I know this might be a common problem.
Is there any alternate or better way to go about this.
Would appreciate your response..
Shikhar