I am trying to use Postgresql with Spring.
The way it was written was to initiate DataSource instance for each query/specific set of queries that was about to be executed.
So, the question is, is it a good idea to keep only one instance for the entire lifetime of the app or do as is now?
Will this lead to any memory leak if many instances are used here?
DataSourcewithConnection. An instance of the first provides instances of the second. Really a misnomer, 'DataSource' should have been named 'ConnectionSource'.