Menu

Proxy cache

2005-03-01
2013-03-07
  • victor Saquicela

    In your code:

    'scan the cache for the object.  If found return it.
            'Also if the current object is a proxy object we must load it.  We cannot look in the cache.
            If useCache And m_useCache And Not obj.IsProxy Then
                If useFind Then
                    tmpObj = m_cache.Find(obj)
                Else
                    tmpObj = m_cache.Item(obj)
                End If
            End If

    always retrive my object, because my obj.isproxy alwas is true.

    If I do obj.isProxy=false before of execute obj.find, this change of cache or not.

     
    • Richard Banks

      Richard Banks - 2005-03-01

      Turning off the proxy flag should force the cache to be read.

      From your other post I think I understand what you are seeing.

      1. When you do a retrieve criteria you get a cursor back with all the objects that can be loaded.  By default these will all be proxy objects.

      2.  Each time you iterate through the cursor and do a loadobject() because the object is a proxy it forces a read from the database  - even though the object may already be in the cache.

      I'll have a look at and see if I can improve it.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.