Only 48 hours left in the trailboss' kickstarter!

New rewards and stretch goals. CLICK HERE!



  • Post Reply Bookmark Topic Watch Topic
  • New Topic

loosing the properties value from servlet in certain time duration  RSS feed

 
Soni Mitesh
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

in one servlet i am initializing properties and initializing logs
in init() method,
inside init() method i am reading properties to get the database
connection details, all these sequence is running properly
the problem is that i have to reload the servlet or context daily,
as it is loosing the values read from the properties after some times

private ServletContext application;
application = config.getServletContext();

propFile = application.getInitParameter("propFile");

reading from properties which i am using
dbDriver=AppProperties.getPropSetting("DB_DRIVER","org.gjt.mm.mysql.Driver");

to escape from this problem i have again initialized the properties in doPost() method.

but the problem remains as intact, please some one put light on it.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What kind of object does AppProperties point to?

I dont see any method "getPropSetting" in the java.util.Properties class so it must be some non-standard tool.

Bill
 
Soni Mitesh
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
of course it is non-standard tool but it not a problem since it is being used in other codes.
so the main question remains stand tall is how could servlet loose property value or
is there any chance of being GC ?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Soni Mitesh wrote:of course it is non-standard tool but it not a problem

Well then, I guess our work is done here.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65824
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
P.S. You might want to look up the parable of the files and honey.
 
Soni Mitesh
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, Bear Bibeault and William Brogden and ranchers i do apologize for that confrontational sentence.
i will be very careful now on words.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Soni Mitesh wrote:of course it is non-standard tool but it not a problem since it is being used in other codes.
so the main question remains stand tall is how could servlet loose property value or
is there any chance of being GC ?

So it's not actually the servlet code that is forgetting values, but rather the AppProperties object, correct? In that case it seems that the question of how that object works, and how it is used elsewhere in the code is highly relevant.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!