The judge shall, at the outset of the proceedings, unless the parties or the sole constituted party waive this, hold a hearing at the end of which he shall take the necessary measures to ensure the existence of the spouses and children from the filing of the application for divorce to the date on which the judgment becomes res judicata, taking into consideration any agreements of the spouses.