Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-79262

Cache is not cleared after create, delete, create for the same object

Details

    Description

      Reproduction steps 6.2.x

      Deploy the attached plugin (the attahed zip file) and place it on a page. On each page reload, the plugin does the following:
      1. Add a Foo
      2. Delete the Foo
      3. Search for the Foo using a Finder

      Result: see attached stacktrace (.log file)
      Actual: ObjectNotFoundException
      Expected: NoSuchFooException

      Reproduced
      6.2.x branch.
      Master
       
      Further notes from EE team

      What I've gathered so far, is that when Foo is deleted, it is deleted from the EntityCache, but not from the FinderCache. When it is being queried via the API, its primaryKey is found in the FinderCache - since it's not in the EntityCache however, it is being queried from the database, which does not contain it, hence the exception.


      The plugin was built using the Plugins SDK 6.2 SP20, using the sample service-builder plugin but adding a Finder to it, as well as a "findBy" method to call the generated persistence API.


      QA information - Master

      Reproduction steps

      1. Start portal master
      2. Deploy the attached jar files (finder.service.builder.api and finder.service.builder.service)
      3. Run the attached groovy script (testFinderCacheIssue.groovy)

      Expected result after the fix: finder.service.builder.exception.NoSuchFooException
      Original behavior before the fix: com.liferay.portal.kernel.dao.orm.ObjectNotFoundException

      Attachments

        Issue Links

          Activity

            People

              sharry.shi Sharry Shi
              amadea.fejes Amadea Fejes (Inactive)
              Kiyoshi Lee Kiyoshi Lee
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                5 years, 2 weeks ago

                Packages

                  Version Package
                  7.0.0 DXP FP47
                  7.0.0 DXP SP8
                  7.0.X
                  7.1.0 Beta 1
                  7.1.X
                  7.2.X
                  Master