DB directly has access to data that DB cache deals with.

Data (data in data tree that is loaded by DB cache) in DB cache is latest comparing to data in DB. It is because data is recorded in DB caches first and then it is recorded in DB.

Therefore, if you directly record data in DB irrespective of data tree that DB cache manages, there might be an unexpected error because the status of data in DB is old for a moment. This is similar with data race condition issue.

db_cache_data_race.jpg
Data race condition by DB cache vs. DB access

But you might need to directly manage data tree (that DB cache manages) in DB. In this case, ProudNet provides data isolation function in order to avoid data race condition.

Data isolation is the function that deactivates the right of using data tree (that you want) at DB cache so that data race condition cannot be occurred in spite of direct DB access.

db_cache_isolate.jpg
Data isolation

The way of use is as below.

  • By using Proud.CDbCacheClient2.RequestIsolateData(X), call data tree that needs to be directly accessed from DB. After that, X will be isolated. In case X has been loaded already, it will be unloaded.
  • If Proud.IDbCacheClientDelegate2.OnDeisolateDataSuccess(X) is called back, you will be allowed to access to X in DB.
  • In case X is isolated, DB cache cannot load X.
  • When DB access relevant to X is done, please release X isolation. Please call Proud.CDbCacheClient2.RequestDeisolateData().
db_cache_isolate_usage.jpg
Data isolation usage