In one of the Jar files, we have the class file like this...
Due to this, the variable "allEmployees" will get the data from the database only for the first time of invocation of the method "getEmployees". From the second time onwards, the data will be stored permanently in the variable "allEmployees" and will be returned directly. It will not go inside the IF loop from the second time onwards. Due to this, if any new Employeed are added in the database, it is not fetching the data from the database. It is returning the previously stored data only. We need to restart the application each time, to make the variable "allEmployees" value null. Is it possible to access this variable from another class and forcibly make this varible null, so that it will go inside the if condition and will fetch the data from the database when ever we required
Hi Jesper, Thank you for your reply. But at the moment, already the application is UP and RUNNING. We cannot do the modification right now as it is in a JAR file. So, I am trying to hack using Eclipse. If it is possible to do something from Java programs which are not present in the JARs, I am ready to do that. Please comment
You have a bug in your program. The way to fix that is to change the code, recompile, and redeploy. Surely your planning didn't assume that the program would never need any maintenance and would only be deployed once in its entire life cycle?
Sounds like singleton pattern. i think your are fetching some comman functionalities(example : UI datas, etc..) required to an application. so that when next user login he can reuse existing object. why do you want to change it? because of the change make easier to *test*? then as jesper stated go for reflection api. i do recommend to restart server rather then jumping into reflection
Hemanth Kumar Simhadri
posted 8 years ago
Surely there will be a maintainence. But I am looking for some temporary solution. We already planned for a permanent fix.
Hemanth Kumar Simhadri wrote:Hello Jeff,
Surely there will be a maintainence. But I am looking for some temporary solution.
Sounds like you already have one: Restart the app.
I don't know what else you think you might be able to get a running app to do to execute different code than what you deployed, and even if you do come up with something, I have a hard time imagining it would be easier or safer than deploying a simple code change.