Flush data file from time to time
Publicdb: reraise exception if uncatched