2014-07-28 : rewrite switch db and fix multithread updatebook