Modification of method setAttribute for user and methods for cache

Database changes are reflected in the cache.