5 Replies Latest reply on Feb 22, 2011 8:27 AM by mircea.markus

    what happens, when updating a bean object  in replication?

    amalrajvinoth

      Dear all,

       

      please give ur suggestion for the following

       

      1. what happens, when updating a bean object  in replication? 

                when a particular field is updated using setMethod(...), only modified value sent or whole obj is sent?

                how to verify this?

         2.what happens in case of invalidation

       

       

      please share ur ideas

       

      thanks.

       

      regards,

      amal.

        • 1. what happens, when updating a bean object  in replication?
          brenuart
          1. what happens, when updating a bean object  in replication? 

                    when a particular field is updated using setMethod(...), only modified value sent or whole obj is sent?

                    how to verify this?

          Nothing happens unless you explicitly put() the object back in the cache after modification.

          Note however that, depending on your configuration, the same object instance might be returned by your local cache on subsquent get. This means that modifications applied to it might be visible - but the cache won't be aware of them (because you haven't put it back).

           

           

             2.what happens in case of invalidation

          Invalidation means you tell other nodes of the cluster that a particular key has been modified - but you don't transfer them the new value.

          With invalidation, the key is removed from your local cache.

          With replication, the new key is updated.

          • 2. Re: what happens, when updating a bean object  in replication?
            amalrajvinoth

            Hello Bertrand Renuart,

             

                 Thanks for ur quick reply,

             

            Actually i am using put() after modifying as follows,

             

               creating and putting bean obj

             

                               Address address = new Address();

                                address.setStreet("3rd Street");

                                address.setCity("MA");

                                address.setZip(640001);

                                cache.put("address", address);

             

             

                    modifying th e bean obj...

                       

                                 address = (Address) cache.get("address");

                                 address.setCity("CA");

                                 cache.put("address", address);

             

            in this case what happens...

             

            does it send whole obj or only the City...

             

             

            thanks.

             

            regards,

            amal.


            • 3. Re: what happens, when updating a bean object  in replication?
              brenuart

                      modifying th e bean obj...

                         

                                   address = (Address) cache.get("address");

                                   address.setCity("CA");

                                   cache.put("address", address);

               

              What do you think?

              How could Infinispan detect what are the changes in your bean/bean graph? Your bean is not instrumented and there is no "session-like" concept like in Hibernate...

               

              So the answer is: currently, the whole Address will be transfered.

              • 4. what happens, when updating a bean object  in replication?
                amalrajvinoth

                thanks a lot for ur response.

                • 5. Re: what happens, when updating a bean object  in replication?
                  mircea.markus
                  and there is no "session-like" concept like in Hibernate...

                  http://community.jboss.org/wiki/OverviewofHibernateOGM