开发者

Compass & Hibernate: prevent inflation of proxy objects during indexing

开发者 https://www.devze.com 2023-03-15 18:20 出处:网络
I am trying to prevent my compass (2.2) indexing from inflating lazy hibernate references. I know there is a setting for this

I am trying to prevent my compass (2.2) indexing from inflating lazy hibernate references.

I know there is a setting for this

compass.marshalling.hibernate.initializeProxy

But after a lot of debugging the compass sources I found out, that this setting is not even passed to HibernateProxyExtractor.

I am applying the setting in my XML config as follows, is this correct?

<bean id="compass" class="org.compass.spring.LocalCompassBean">
    <!-- .... -->
    <property name="compassSettings">
        <prop key="compass.marshalling.hibernate.initializeProxy">false</prop>
        <!-- ... -->
    </property>
</bean>

While debugging, I found out that DefaultConverterLookup creates and configures ClassMappingConverter (which in turn configures ProyExtractorHelper which in turn configures HibernateProxyExtractor). However, configuration settings are only passed to ClassMappingConverter, if they are prefixed with "compass.converter" (CompassEnvironment.Converter.PREFIX), which is not the case for compass.marshalling.hibernate.initializeProxy

Note: I am not at all a Compass/Lucene expert, so maybe I just do not get h开发者_如何转开发ow to configure this correctly.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号