Menu

delete Object

2004-09-02
2004-09-03
  • victor Saquicela

    I have the last CVS of delete cache.

    Whe i try delete a object, produced a error in :
    Private Sub deletePrivateObject
    ..
    ..
    If m_useCache Then
                m_cache.Remove(obj) 'remove from the cache
    End If

    I comment this code and this is correct.

     
    • Richard Banks

      Richard Banks - 2004-09-02

      Hi Victor,

      I've done testing on the delete locally and can't get it to fail.  Can you let me know what the error message is that you are getting.

      The delete call shouldn't be commented otherwise the cache may return the deleted object during retrieve operations.

      - Richard.

       
    • victor Saquicela

      Hi.
      I understant that, what if  i comment, the object is in the cache, but if i don't comment, it is produce a mistake:

      Excepcin no controlada del tipo 'AToMSFramework.DeleteException' en microsoft.visualbasic.dll

      Informacin adicional: Referencia a objeto no establecida como instancia de un objeto.

      In this code is produced a mistake(  Class:CCacheEntry /////  Public Overloads Sub Remove(ByVal obj As CPersistentObject)
      ):

      If obj.getClassMap.RelationalDatabase.getConnection(Nothing).Started Then
                  ce = MyBase.Item(ckey)
                  ce.TransactionType = CCacheEntry.CacheTransaction.Deleted

       
    • victor Saquicela

      What happen if the object isn't in the cache ???

       
    • Richard Banks

      Richard Banks - 2004-09-02

      Argh!  You're right and I'm blind :-)

      Simple change:

      If obj.getClassMap.RelationalDatabase.getConnection(Nothing).Started Then
        ce = MyBase.Item(ckey)
        If Not (ce Is Nothing) Then
          ce.TransactionType = CCacheEntry.CacheTransaction.Deleted
        End If
      Else
        MyBase.Remove(ckey)
      End If

      I'll update CVS.

      Thanks,
      Richard.

       
    • victor Saquicela

      All right.

      Excellent work. I am going to continue trying your code.

       

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.