Bug 528939 - Cache problem when deleting containers (and possible solution)
Summary: Cache problem when deleting containers (and possible solution)
Status: UNCONFIRMED
Alias: None
Product: OM2M
Classification: IoT
Component: Platform (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-19 05:40 EST by Nobody - feel free to take it CLA
Modified: 2017-12-19 05:40 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nobody - feel free to take it CLA 2017-12-19 05:40:07 EST
Assuming you have a structure like this:
cb:Cb
-> cnt1 : Cnt
--> cnt2: Cnt (child of cnt1)
--->cnt3: Cnt  (child of cnt2)

If you delete cnt3, you will still be able to "see" cnt3 by sending a retrieve request to cnt2 with e.g. rcn=4 (including children). 

It seems there is a problem with the cache. After a restart of oM2m, cnt3 is fully gone and not visible anymore by utilizing the rcn attribute. 

I think the main cause lies in this class:
org.eclipse.om2m.persistence.eclipselink\src\main\java\org\eclipse\om2m\persistence\eclipselink\internal\dao\ContainerDAO.java

In the method "public void delete(DBTransaction dbTransaction, ContainerEntity resource)", I had to evict also the ContainerEntity class to get it running =>
"transaction.getEm().getEntityManagerFactory().getCache().evict(ContainerEntity.class);"

If I looked it up correctly, all branches are affected by this problem.