While the ConnectionFactory connection source is the easiest way to implement custom connection sources, it currently does not provide an option to close the DataSource.
The closure of a DataSource created by ConnectionFactory must be done via external means.