implemented pre-query cache flush only for involved types
CmakeList swig bux fix