I have a situation where i have to run a method once only for one empID. Let me explain code wise.
oldDataObject = converter.retrieveByID(EmpID);
The above line of code runs in one class and being called from other java class. I want a filter that id EmpID is passed same , donot run this method and just return the previously processed and retreived DataObject. I tested my code and this method is called 5 times with same EmpID and firing huge DB statements each time to fetch the same object. I was looking to improve the performance. Can you please tell me to run this code once per ID and store the value and compare the ID next time its called and skips if it is same ID and return the already retrieved object. Please help