Section 47. The justices or notaries shall thereupon cause notice of the time and place appointed for taking the deposition to be given to all persons named in said statement as interested in the case, in the manner provided in sections twenty-six to twenty-nine, inclusive; and if in the opinion of the justices or notaries no sufficient provision is made by law for giving notice to parties adversely interested, they shall cause such reasonable notice to be given as they consider proper. A person may be summoned and compelled to give a deposition in perpetuation of his testimony in like manner and under the same penalties as are provided for a witness before a court.