change $db->get_temorary_id_table not to require a transaction