getBeans() always returns the cached value even if asked not to

I have a logic_hook, well a series of logic hooks really, that creates two RLIs, then updates those RLIs and then in another hook it tests those RLI to see if they are completed.

The update is to set them to completed.  I looked in the DB and they are set to completed.

That last step (in another logic file) has this code

            $oppBean->load_relationship('revenuelineitems');
            $rliBeans = $oppBean->revenuelineitems->getBeans(array('use_cache' => false),array('use_cache' => false));

Which returns the two RLIs but BOTH of them are shown as NOT being completed.  I looked at the getBeans() function and there is no mention of the 'use_cache' param.  If its in the cache it just returns it.

Also I dont know why the update to completed is not reflected in the cache but I see that a lot.  I use the 'use_cache' param just about everywhere in system-wide code (stuff that users dont generally run in the UI). 

My current work around is to do this

$oppBean->load_relationship('revenuelineitems');
			$oppBean->revenuelineitems->beans=array();
            $rliBeans = $oppBean->revenuelineitems->getBeans(array('use_cache' => false));

So I empty the cache before I getBeans().

Does anyone have some wisdom for me?

Parents Reply Children
No Data