AutomaticCacheCoherency and out of date objects

For questions and postings not covered by the other forums
cnwep1
Posts: 2
Joined: Tue Aug 18, 2009 8:44 am

AutomaticCacheCoherency and out of date objects

Postby cnwep1 » Thu Apr 14, 2011 9:32 am

Hi,

I've been looking into a problem and the symptoms could be caused by a node having an old edition of an object (that had just been updated on another node). We have the AutomaticCacheCoherency option on for all nodes. Just wondering if anybody has come across cases where Jade AutomaticCacheCoherency feature doesn't keep up with things and it's possible to be using an out of date edition? And if this is possible what strategy do you use to avoid issues? the resynch and resynchObject methods have no effect. So the only other option would seem to be to lock the object.

Cheers

JohnP
Posts: 73
Joined: Mon Sep 28, 2009 8:41 am
Location: Christchurch

Re: AutomaticCacheCoherency and out of date objects

Postby JohnP » Thu Apr 14, 2011 12:17 pm

My understanding is that if you have a non-collection object already in your node's cache, you can continue to access it even though someone in another node has it exclusively locked. You can't fetch it from the database or lock it, but you can access it if you already have it in cache.

You could retry the transaction, like you would do for a deadlock.

Rich
Posts: 4
Joined: Tue Jun 23, 2009 8:33 am

Re: AutomaticCacheCoherency and out of date objects

Postby Rich » Thu Apr 14, 2011 1:50 pm

From the Object Manager Guide : "When a transaction is
committed, the server sends a message to each client, identifying the objects that have been
updated. On receipt of this message, the client marks all updated objects that are present in the
cache as being obsolete. The next time a process on the client attempts to access the obsolete object,
the updated copy is retrieved from the server."

This means that there is a small window between the time that the server commits the updates and the time that the client node marks the object as obsolete. For many applications, this may not matter, but when object currency is paramount you need to lock the object.

User avatar
BeeJay
Posts: 312
Joined: Tue Jun 30, 2009 2:42 pm
Location: Christchurch, NZ

Re: AutomaticCacheCoherency and out of date objects

Postby BeeJay » Thu Apr 14, 2011 4:53 pm

If your code absolutely requires the latest version of the object, the only way you can 100% guarantee that you have the latest version is to place a lock on the object for the duration of your requirement.

Cheers,
BeeJay.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 29 guests

cron