fix flushing cache when using sqlite datasource - closes #2176