Class ResourceRegistryStandardImpl

java.lang.Object
org.hibernate.resource.jdbc.internal.ResourceRegistryStandardImpl
All Implemented Interfaces:
ResourceRegistry

public final class ResourceRegistryStandardImpl extends Object implements ResourceRegistry
Helps to track Statements and ResultSets which need to be closed. This class is not threadsafe.

Note regarding performance: we had evidence that allocating Iterators to implement the cleanup on each element recursively was the dominant resource cost, so we decided to use "for each" and lambdas in this case. However, the "for each"/lambda combination is able to dodge allocating Iterators on HashMap and ArrayList, but not on HashSet (at least on JDK8 and 11). Therefore some types which should ideally be modelled as a Set have been implemented using HashMap.