Streams Do Not Close All Database Resources
Created by: apcarp
The DatabaseSourceStream do not close the PreparedStatement and ResultSet explicitly when the close() method is called. In many cases this is not a problem as application server connection pools may close associated resources while reseting the connection upon application release. However, the OnDemandNexus and the MariaDbPoolDataSource do not appear to close all of the associated database resources on connection close.
Note: This led to unexplained performance improvements when testing more complex MySamplerStream strategies that were not seen in production. This appears to be because closing the ResultSet when only some rows have been fetched triggers the rest of the data to be fetched. This is somewhat of a guess, but timing the operations supports the idea.