-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 7.0.X, Master
-
Fix Version/s: 7.0.0 DXP FP47, 7.0.0 DXP SP8, 7.0.X, 7.1.0 Beta 2, 7.1.X, Master
-
Component/s: Core Infrastructure > Service Builder
-
Branch Version/s:7.0.x
-
Backported to Branch:Committed
-
Story Points:1
-
Fix Priority:3
-
Git Pull Request:
When using columns with String as type and null convertible caches aren't cleared properly. The reason is that we can use the null value to search, but to clear cache we use to form the key the gettter, so we never clear the elements inserted with null as key.
Steps to Reproduce:
- Execute the following Groovy script:
import com.liferay.journal.service.JournalContentSearchLocalServiceUtil; import com.liferay.counter.kernel.service.CounterLocalServiceUtil; import com.liferay.journal.model.JournalContentSearch; import com.liferay.journal.service.persistence.JournalContentSearchUtil; import com.liferay.portal.kernel.security.auth.CompanyThreadLocal; import com.liferay.portal.kernel.model.Company; import com.liferay.portal.kernel.service.CompanyLocalServiceUtil; long companyId = CompanyThreadLocal.getCompanyId(); Company company = CompanyLocalServiceUtil.getCompany(companyId); long groupId = company.getGroupId(); boolean privateLayout = false; long layoutId = 1L; String portletId = "A_PORTLET_ID"; String articleId = null; long contentSearchId = CounterLocalServiceUtil.increment(); JournalContentSearch contentSearch = JournalContentSearchLocalServiceUtil.createJournalContentSearch(contentSearchId); contentSearch.setGroupId(groupId); contentSearch.setCompanyId(companyId); contentSearch.setPrivateLayout(privateLayout); contentSearch.setLayoutId(layoutId); contentSearch.setPortletId(portletId); contentSearch.setArticleId(articleId); JournalContentSearchLocalServiceUtil.updateJournalContentSearch(contentSearch); JournalContentSearchLocalServiceUtil.deleteArticleContentSearch(groupId, privateLayout, layoutId, portletId, articleId); try{ JournalContentSearchLocalServiceUtil.deleteArticleContentSearch(groupId, privateLayout, layoutId, portletId, articleId); } catch(Exception e) { out.println(e); }
Expected Results:
No exception should be printed when trying to remove the second time because the record is already deleted.
Actual Results:
An org.hibernate.ObjectNotFoundException is thrown because the list of records to retrieve is cached and therefore tries to delete a record that doesn't exist.
- causes
-
LPS-81706 Count* and related fetch* methods are returning inconsistent results when using null values in a null convertible string column
- Closed
-
LPS-81707 FinderCache isn't using cached values when using null values in a null convertible string column
- Verified
- fixes
-
LPS-81038 Possible unique constraint duplicated in JournalServiceVerifyProcess
- Closed
- is related to
-
LPS-3115 Blocking cache never released in some circumstances
- Closed
- Testing discovered
-
LPS-81704 FinderCache doesn't work properly when using null values in a null convertible string column (for all cases)
- Closed
-
LPS-81708 FinderCache doesn't work properly when using null values in a null convertible string column and the return value is an empty list
- Closed