[Opensource] Upgrading from 4.02 to 5.02: DBObject question

Michael Rimov rimovm at centercomp.com
Wed Jun 18 15:44:22 PDT 2003


At 02:25 PM 6/18/2003 -0400, you wrote:
>In 4.02, this code worked just fine and the first thread picked up the
>change. In 5.02,
>this breaks and the first thread can only acces the old/stale value. One
>possible
>contributing factor is that thread 1 may be using a derived class:
>
>public class DBExtendedSomeThing extends DBSomeThing {
>         // Just overrides/adds some methods
>}


That is the issue.  Caches are named by DBObject class name.  That's why 
stale values are getting picked up.  To be truthful, I'm not sure why it 
actually worked in the old versions, but I fixed a lot of threading issues 
in the cache, so things may have been working by sheer chance.

The best way that I can see to workaround this issue would be to override 
DBObject.addToCache() for your particular dbobjects to drop the item into a 
specified cache name that both of your objects can find.

HTH!
                                                 -Mike
   





More information about the Opensource mailing list