Hello, I am locally patching around that as well. A simple Arrays.hashCode() seems to break, because it can cause entity loading org.hibernate.proxy.AbstractLazyInitializer.initialize-> into afterTransaction → into org.hibernate.resource.jdbc.internal.ResourceRegistryStandardImpl.releaseResources and after that sometimes some JDBC Statements are closed that are expected to be open. My current idea is to try this, which is probably not correct in all cases, but at least it doesnt crash the application or makes it so slow that it might as well be crashed…: My argument would be that it would be nice if there was an option to completly turn off the entire Natural-Id cache handling. Our application never uses Natural id lookup, the natural ids are just there so that the sql schema generation creates the required unique constraints. As a workaround we could convert natural-ids to explicit unique constraints, but thats a lot of rewriting. 
|