Kuali Rice Development
  1. Kuali Rice Development
  2. KULRICE-3164

KimEntityExternalIdentifierImpl.afterLookup not called when KimEntityImpl is loaded from db

    Details

    • Type: Bug Fix Bug Fix
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0
    • Component/s: Development
    • Labels:
      None
    • Similar issues:
      KULRICE-5825KimEntityImpl & KimEntityInfo use different logic for fetching default items
      KULRICE-7517Improve performance of RoleService by not loading membership information for the RoleBo for nearly every method call
      KULRICE-3816UserXmlParser passing KimEntityEmploymentInformationImpl as class when obtaining entity id from sequence accessor
      KULRICE-9826Loading indication when loading dialog content when retrieved through an ajax call
      KULRICE-4646Remove direct database calls from client applications to rice db where possible
      KULRICE-1752Remove uneccessary calls to GlobalResourceLoader.stop()
      KULRICE-5980Display Server messages/growls that may be a result of an ajax call
      KULRICE-4917Load test development & implementation
      KULRICE-13921Add "Loading" message when returning data from lookup
      KULRICE-1022Improve DB Loading Hooks in Rice Test Harness

      Description

      This method on the external identifier is used to decrypt the value from the database. However, the afterLookup method doesn't appear to be called on all references of an object when the object is loaded. This can be seen in the UIDocumentServiceImplTest.testSaveToEntity which is failing because of this reason. Essentially, when the KimEntityImpl is loaded from the DB, the external identifer value is coming back as encrypted instead of decrypted.

        Activity

        Hide
        Eric Westfall added a comment - - edited

        Adding the following to KimEntityImpl fixes the problem:

        @Override
        public void afterLookup(PersistenceBroker persistenceBroker)
        throws PersistenceBrokerException {
        // afterLookup is not called recursively on all referenced objects, external entities can be encrypted coming out of the db, so let's resolve this by manually walking down
        super.afterLookup(persistenceBroker);
        if (getExternalIdentifiers() != null) {
        for (KimEntityExternalIdentifierImpl extId : getExternalIdentifiers())

        { extId.afterLookup(persistenceBroker); }

        }
        }

        I'll add that to 1.0 but let me know if you think that's a bad solution for any reason.

        Show
        Eric Westfall added a comment - - edited Adding the following to KimEntityImpl fixes the problem: @Override public void afterLookup(PersistenceBroker persistenceBroker) throws PersistenceBrokerException { // afterLookup is not called recursively on all referenced objects, external entities can be encrypted coming out of the db, so let's resolve this by manually walking down super.afterLookup(persistenceBroker); if (getExternalIdentifiers() != null) { for (KimEntityExternalIdentifierImpl extId : getExternalIdentifiers()) { extId.afterLookup(persistenceBroker); } } } I'll add that to 1.0 but let me know if you think that's a bad solution for any reason.
        Hide
        Jonathan Keller added a comment -

        I guess I'm wondering why this is happening during the tests and not when the app is running normally. The tax ID on the person document seems to have been working fine in Rice and KFS since this change went in.

        Show
        Jonathan Keller added a comment - I guess I'm wondering why this is happening during the tests and not when the app is running normally. The tax ID on the person document seems to have been working fine in Rice and KFS since this change went in.
        Hide
        Eric Westfall added a comment -

        It looks like Poonam fixed this by doing an explicit "refresh()" on the KimEntityImpl in IdentityServiceImpl.getEntityImpl

        Show
        Eric Westfall added a comment - It looks like Poonam fixed this by doing an explicit "refresh()" on the KimEntityImpl in IdentityServiceImpl.getEntityImpl
        Hide
        Eric Westfall added a comment -

        Bulk change of all Rice 1.0 issues to closed after public release.

        Show
        Eric Westfall added a comment - Bulk change of all Rice 1.0 issues to closed after public release.

          People

          • Assignee:
            Eric Westfall
            Reporter:
            Eric Westfall
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Structure Helper Panel