doWriteBatch and riwah