6.2.X EE, Master
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)
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
- Start portal master
- Deploy the attached jar files (finder.service.builder.api and finder.service.builder.service)
- 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