cqengine
cqengine copied to clipboard
None fluent API for TransactionalIndexedCollection
When using TransactionalIndexedCollection and running queries using retrieve(...), one needs to save the ResultSet in a temporary variable so we can close it later, otherwise the readLock remains held.
We can do try-with-resources to clean the code a bit, but as the returned result is already an iterable, most of the time we want to just call stream or do something else with the returned collection.
It'd be great if the API transforming the Iterable into a stream (i.e stream()) could read the elements and close the ResultSet, for the very least accept some flag to instruct him to do so.
That would allow for a much cleaner and usable API in the transnational case.