Menu

I need Instruction for Use Cache.

2004-08-31
2013-03-07
  • Nobody/Anonymous

    In Transaction with Save Many Objects When I Save Each Object( I think your program keep object in cache for each save )
    IF Transaction is rollback database is rollback correct  but cache is not rollback.

    What should I do?

    I need you to guide me to solve this problem.
    I have no idea to solve it.

     
    • Richard Banks

      Richard Banks - 2004-08-31

      Hi,

      I've just read your post and it occurrs to me that I've never actually checked for this, and that it's a definite problem :-(

      The framework should handle it for you, so let me have a look at my code and fix it.  I'll post a message when the changes are done.

      - Richard.

       
    • Richard Banks

      Richard Banks - 2004-09-02

      Hi,

      This problem is fixed now and CVS has been updated.  Please get the latest code from there.

       
    • Nobody/Anonymous

      Hi Richard

          This problem, I get it now. I use AtomsFramework 2.0

      "IF Transaction is rollback database is rollback correct but cache is not rollback. "

      Help me please

      Anya

       
    • Nobody/Anonymous

      Hi.

      I have a same problem.  I am using  Atomsframework 2.0 and the last CVS.

      To solve this problem i am deleting a cache, but it isn't the major solution

       
    • Richard Banks

      Richard Banks - 2005-01-19

      I'll need to check this.  The cache should be restored to it's pre transaction state if a transaction is aborted so I assume something must be broken.

      Can you tell me what method for persistence you are using?  (ie inheriting from CPersistentObject, or not)

      Even better would be some code that duplicates the problem :-)

       
    • Nobody/Anonymous

      Hi,Richard

      mproduct is inheriting from CPersistentObject.
      and my code as :

      Try
          persistenceBroker.startTransaction()
          m_product.Save()
          'persistenceBroker.commit()
          persistenceBroker.rollback() ' For test rollback
      Catch ex As Exception
          persistenceBroker.rollback()
          Throw ex
      End Try

      Anya

       
    • Nobody/Anonymous

      if u cann't solve this problem at this time,
      how can i clear cache or not use cache or Other suggests?

      Anya Is My Colleague
      Monsak.

       
      • Richard Banks

        Richard Banks - 2005-01-31

        Ooops. Sorry. I've been on annual leave and I forgot about this problem.

        It's fixed and tested now and I've updated CVS.  You will need to get the latest version of the source code from there.

        Let me know if there are any other problems.

        - Richard.

         
        • Nobody/Anonymous

          I and Anya have download from cvs at http://cvs.sourceforge.net/viewcvs.py/jcframework/dotnet/?sortby=date#dirlist

          Files
          1) CPersistenceBroker.vb      (R 1.88)   4 weeks
          2) CPersistentCollection.vb    (R 1.15)   5 weeks
          3) CPersistentObject.vb        (R 1.52)   6 weeks

          to update my machine atomsframworks v2.0
          but it's not work for this case

          Help Me,Please
          Monsak

          Please apologize Me, in my office i cann't log this site. I don't know why.

           
    • Richard Banks

      Richard Banks - 2005-01-31

      The public CVS takes time to update from the developer version (and lately it's been quite slow).

      You will need the latest CConnection.vb code (when it becomes available).

       
    • Nobody/Anonymous

      Hi.

      I have a last CVS. But it isn't correct.

      I am removed any objects of the collection and when i am executed rollback, only database is executed and not cache.

       
    • Nobody/Anonymous

      Why if I remove a object of the collection and executed rollback, this collection don't have a object????????????

       
    • Richard Banks

      Richard Banks - 2005-01-31

      Collections are a pain.  I've duplicated the problem here.

      The issue comes because the collection itself is not actually stored in the cache.  The object that references the collection (objA) is in the cache, and the objects that are part of the collection (objB, objC, etc) are also cached, but the collection object itself (ie the CPersistentCollection) is not.

      What then happens is that the ObjA, ObjB, etc objects are correctly restored to their previous state when the transaction aborts, but that the referenced collection object is not restored.

      I need to figure out a clean solution to this, so give me a little time. (I've created a bug entry so that I don't forget).

       
      • Richard Banks

        Richard Banks - 2005-02-02

        OK, CVS is now updated with the latest code to correctly restore collections.

        I have only tested it with the CPersistentCollection at this stage, however the code works the same regardless of collection type so it should be fine for array lists, hashtables, etc.

        Collections that implement ICloneable are copied using the clone method, other collections are copied using a for-each loop.

        Please try it out and let me know if you find any issues or problems.

        - Richard.

         
    • Nobody/Anonymous

      Hello Richard Banks

      i get source code from CVS and Test about My case I work. but CVS server update too slow i wait for source code from CVS about 9 hours.

      Thanks a lot.
      Monsak

       
    • Nobody/Anonymous

      To solve this problem, i am clear cache, but the solution of cache rollback of the collection is better.

      Saludos

      Victor

       

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.