sujith Acharya wrote:
Minor note: the above code is not
thread save. So in case you're accessing getObject from multiple threads (which usually happens when used within a webapplication) you'll need to add the synchronized keyword:
Else you'll might get more objects than wanted, if getObject gets executed at exactly the same time.