entity cache helper - double checked locking pattern added.