You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
When using
TransactionalIndexedCollection
and running queries usingretrieve(...)
, one needs to save theResultSet
in a temporary variable so we can close it later, otherwise thereadLock
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 callstream
or do something else with the returned collection.It'd be great if the API transforming the
Iterable
into a stream (i.estream()
) could read the elements and close theResultSet
, 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.
The text was updated successfully, but these errors were encountered: