Hi,
can you please give me advice how to delete object from hibernate cache or tell me what I am doing wrong during MapSymbol add action?
These are steps how to reproduce the problem:
1. discover some nodes (ManagedObjects)
2. create domain called e.g. "test"
3. cut and paste node into "test" domain
4. delete "test" domain.
5. create "test" domain again
6. paste the same node again into "test" domain
I have implemented the paste action on server side. Here I use (delete and add is called because mapName cannot be updated):
Properties props = mApi.getSymbolProperties(oldDomain, objectName);
mApi.deleteSymbol(oldDomain, objectName);
props.put("name", objectName);
props.put("mapName", newDomain);
MapSymbol mapSymbol = new MapSymbol();
mapSymbol.setProperties(props);
boolean flag = mApi.addSymbol(newDomain, props);
This works correctly for cut and paste without delete of parentDomain or when you paste node into different domains than "test". But when I do steps 1 - 6 then addSymbol action returns false. I think that this is problem of hibernate caching because this is not happening in a case that server is restarted after delete action (4th step) and steps 5 - 6 are done after server restart or when I change maxElementsInMemory="50" to "0" for com.adventnet.nms.mapdb.MapSymbol in WebNms/classes/hbnlib/ehcache.xml.
When domain is deleted then child ManagedObject node is updated via:
topo.updateObject(obj, false, false);
mapAPI.updateMap(objMapName, sysMapProps);
and domain is deleted via:
mapAPI.deleteSymbol(parentMapName, domainName);
mapAPI.deleteMap(mapName);
In DB all data are updated correctly.
Can you please help me with these problem? I am interested if there is another way how to fix it without cache disabling.
Thank you very much for your help,
Lidka