Triggering rollback when entitystate is changed from modified to unchanged.

Added functional test

Both unit and functional tests pass now