Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Optimistic locking and refreshing cache

463120Mar 18 2006 — edited Apr 18 2008
My current project involves accessing a legacy database. The legacy app will continue to access and modify the db as always. So we added a "ROW_VERSION" column to every table in the db and for every descriptor:
useVersionLocking("ROW_VERSION", false);
onlyRefreshCacheIfNewerVersion();
disableCacheHits();
alwaysRefreshCache();

It was my understanding that these settings should insure that all reads will check the database to see if the row_version of the object in cache matches the value in the db, and if not the object in cache will be refreshed. This is not the case. The cached object becomes stale after the external update (expected) and is not refreshed from the db on subsequent reads (unexpected). Only calling session.removeFromIdentityMap on the object forces the db read.

Thanks, Frank
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 16 2008
Added on Mar 18 2006
11 comments
1,815 views