5 Replies Latest reply: Jun 20, 2012 10:02 AM by 933819 RSS

    user item descriptor

    933819
      Hi,
      Just want to confirm, per ATG documentation, once you have a mutable repository item, you can have as many call as you want to setPropertyValue method, but changes are not reflected util you call the updateItem method, in one of my form handlers I get the user item (as a mutable repository item) and set it's default credit card to null, changes are getting through the physical table in the database (dcs_user) even though there's no explicit call to the updateItem method, is this behavior a normal one, user item does not need a updateItem method call separately?

      Thanks,
      RM
        • 1. Re: user item descriptor
          Suresh Repalle
          Yes, you are correct. you dont need to call the updateItem method for Profile updates, because profile has a different behavior compare to other repositories.
          • 2. Re: user item descriptor
            Clarer-Oracle
            The most likely explanation for the behavior you saw is that your form handler did not create a transaction around all the setProperty calls. If there is no enclosing transaction, the GSA commits each setProperty call separately. This can be inefficient if you update a lot of properties, but it prevents updates from getting lost if an application is not carefully coded.

            All GSA repositories behave the same way. There is nothing special about the profile repository. Some applications redefine the profile repository to use LDAP, which may behave differently. I'm not very familiar with the LDAP repository implementation.
            • 3. Re: user item descriptor
              Gautam Singh
              I agree with Clare. The database update happens based on transaction and will happen no matter if updateItem is called or not.
              ATG Repository guide is somewhat misleading and I think it's because in earlier ATG version updateItem() call was required to persist repository data.

              Though updateItem is not essential it's always good practice to follow the pattern as talked in Repository guide:
              Call getItemForUpdate(), followed by one or more setPropertyValue() calls and finally call updateItem()
              • 4. Re: user item descriptor
                933819
                Makes a lot of sense to me, at the same time agree that ATG rep guide is a little misleading..they do not talk about calls to setters on mutable repository items in and outside enclosing transactions. Thanks guys for the explanation, yes my FH doesn't wrap the setter call in a transaction, even I was confused because profile repository is just like any other GSA.
                • 5. Re: user item descriptor
                  933819
                  Thanks all for the inputs.