-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Milestone
Description
Pablo Díaz-López opened DATAMONGO-1076 and commented
If we load a Document class that has a lazy annotated DBRef, and we do not navigate through it, the data is not requested to MongoDB as expected, but if we force a GC it seems that the proxy that envelops the attribute with DBRef generates a request to MongoDB.
You can see this issue in logs if trace logs are enabled:
Example to a DBRef to MY_DB.PEOPLE with id=18
2014-10-27 12:24:02.644 INFO 4384 --- [ Finalizer] com.mongodb.TRACE : find: MY_DB.PEOPLE { "_id" : 18}
And this is the trace I get debugging:
at com.testapp.model.People$$EnhancerByCGLIB$$c7ff2ba0.finalize(<generated>)
at java.lang.System$2.invokeFinalize(System.java:1267)
at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:98)
at java.lang.ref.Finalizer.access$100(Finalizer.java:34)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:210)
The problem seems to be at DefaultDbRefResolver creating the LazyLoadingInterceptor inner class
Affects: 1.6 GA (Evans)
Referenced from: pull request #234
Backported to: 1.6.1 (Evans SR1)