We are having the same issue (connection leak) when a circular relationship is presented. Example: Employee has a collection of Address and Address has a many-to-one relationship to Employee
We are using c3p0 as connection pool and the number of connection grows to the maximum size and then the application is frozen.
To fix this, as workaround, we set the many-to-one side as non-lazy. We're not using a container or app server.
From within the Hibernate code, I can see that the session is nulled out in AbstractPersistentCollection and then the NPE causes the warning message: "Unable to close temporary session used to load lazy collection associated to no session"
I don't understand why the session is not closed properly and is nulled out instead. We were having lots of problem as a lot of our domain object models are like that and we had to make them non-lazy one by one whenever the app crashes.
is this going to be fixed?
Thanks
|