Details
-
Sub-task
-
Status: Closed
-
Top
-
Resolution: Fixed
-
2.10.00
-
None
-
None
Description
Reproduce: Change in LazySessionDelegatingRepository#testLazySessionObject()
String userID2 = session2.getUserID();
assertTrue(((LazySession) session1).isLoaded());
into
String userID2 = session2.getUserID();
System.gc();
Thread.sleep(100);
System.gc();
Thread.sleep(100);
System.gc();
assertTrue(((LazySession) session1).isLoaded());
For some reason the WeakReference<Session> sessionWeakRef; from LazySessionInvoker can be garbage collected. Does the LazySession actualle keep a reference to the invoker? I think something might fail here.
Furthermore, I am not really happy with the invoking proxies methods and usage of WeakReference's how it is currently done. I might be just not familiar enough with this proxy kind of programming. I am however familiar with WeakReference's, and I just think the current setup is error prone, as this issue also proves.
Is there not a better solution available?
Attachments
Issue Links
- relates to
-
HSTTWO-2847 Usage of WeakReference<Session> in LazySessionInvoker leads to memory leak
- Closed