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

Yajun Shi (JIRA) noreply at atlassian.com
Thu Feb 1 14:26:40 EST 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2330?page=comments#action_25967 ] 

Yajun Shi commented on HHH-2330:
--------------------------------

It will help us a lot if you can post a unit test. Thanks.

> 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