[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2330) If loaded entity is cglib enhanced, FieldInterceptionHelper.injectFieldInterceptor() fails to find the field interceptor interface on the entity, leaving the interceptor null

James Sparrow (JIRA) noreply at atlassian.com
Thu Dec 28 12:13:44 EST 2006


If loaded entity is cglib enhanced, FieldInterceptionHelper.injectFieldInterceptor() fails to find the field interceptor interface on the entity, leaving the interceptor null
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

         Key: HHH-2330
         URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2330
     Project: Hibernate3
        Type: Bug

  Components: core  
    Versions: 3.2.1    
    Reporter: James Sparrow
    Priority: Critical
 Attachments: patch1

After upgrading from Hibernate 3.1.3 to Hibernate 3.2.1, entities with lazy property fetching enabled ceased lazily loading the properties. I tracked this down to a problem in the way FieldInterceptionHelper locates the interceptor interfaces on classes. If the loaded entity (i.e., coming through PojoEntityTuplizer.afterInitialize()) is already cglib enhanced, the FieldInterceptionHandler's use of entity.getClass().getInterfaces() will fail to locate the InterceptFieldEnabled interface on the instrumented superclass of the entity (since getInterfaces() only returns interfaces on the type, not supertypes).

This can be fixed by retrieving all interfaces on the class and its superclasses (see attached patch).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira




More information about the hibernate-issues mailing list