What is stale state?

老子叫甜甜 提交于 2019-12-03 04:53:36

Stale state is information in an object that does not reflect reality.

Example: an object's members are filled with information from a database, but the underlying data in the database has changed since the object was filled.

Dangerously stale state is stale state that might adversely affect the operation of a program, i.e. causing it to perform incorrectly due to invalid assumptions about the data's integrity.

It happens when the value stored in the object does not anymore reflect the underlying persistent value. I guess dangerously stale is just a way to say that the value is really outdated.

"Stale state" is when an object's stored (cached) view of the rest of the system becomes out of date. Eg an object is holding a handle to some other object, but the second object has been deleted in the meantime.

Trying to dereference a stale handle can lead to big problems.

Most systems will try to automagically protect you from various reasons for ending up with stale state, but it is not always possible to cover every case. (Depending on the system.)

Larry

Basically, it means invalid state. Usually a by-product of not notifying your instances of state change.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!