0

私はJavaプロジェクトで休止状態を使用していますが、使用している休止状態はレガシーであり、使用しているバージョンが休止状態3であることを意味します。さらに、春専用の休止状態である春の休止状態を使用しています。

私はネットを調べていて、 p6SPY に関して見つけました。hibernate によって生成されたクエリが含まれている jar で、疑問符の代わりに実際のパラメータ値が反映されます。これは開発者の観点から非常に役立ちます。

http://www.mkyong.com/hibernate/how-to-display-hibernate-sql-parameter-values-solution/

今、私は自分のアプリケーションにも同じ機能を持たせたいと思っていますが、以前に言ったように、私は春向けの休止状態を使用しており、さらに休止状態の構成は以下に示すように単一の xml で行われますが、そのような機能を構成する方法を教えてください私のアプリケーションの P6SPY 私の休止状態の xml は次のとおりです..

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING/DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<beans default-lazy-init="true" default-autowire="no">
    <bean id="dataSource" class="com.persist.NullConnectionCheckerOracleDataSource" destroy-method="close">
        <property name="user" value="GTO"/>
        <property name="password" value=""/>
        <property name="connectionCachingEnabled" value="true"/>
<!--        <property name="connectionCacheName" value="ia"/> -->
        <property name="connectionCacheProperties">
            <props>
                <prop key="MaxLimit">20</prop>               
                <prop key="MinLimit">0</prop>
                <prop key="InactivityTimeout">0 </prop>
                <prop key="ConnectionWaitTimeout">60</prop>
                <prop key="PropertyCheckInterval">60</prop>
                <prop key="ValidateConnection">true</prop>
            </props>
        </property>
        <property name="URL">
            <value>jdbc:oracle:thin:@ldap://ccs.fm.ldap://ccsgcm.gcm.com:4042ldap://hkg0799xus.fm.</value>
        </property>
        <property name="connectionProperties"> 
            <props> 
                <prop key="oracle.net.ldap_loadbalance">OFF</prop>
                <prop key="v$session.osuser">@db.osuser@</prop>
                <prop key="v$session.program">@db.program@</prop>
            </props> 
        </property> 
    </bean>

    <bean id="sessionFactoryTemplate" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="dataSource" ref="dataSource"/>
        <property name="configurationClass" value="org.hibernate.cfg.Configuration"/>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
                <prop key="hibernate.jdbc.batch_size">30</prop>
                <prop key="hibernate.show_sql">true</prop>
                <prop key="hibernate.use_outer_join">false</prop>
                <prop key="hibernate.max_fetch_depth">10</prop>
                <prop key="hibernate.default_batch_fetch_size">150</prop>
                <prop key="hibernate.bytecode.use_reflection_optimizer">true</prop>
                <prop key="hibernate.connection.autoReconnect">true</prop>
                <prop key="hibernate.connection.release_mode">on_close</prop>
                <prop key="hibernate.cache.use_query_cache">false</prop>
                <prop key="hibernate.cache.use_second_level_cache">false</prop>
                <prop key="hibernate.cache.provider_configuration_file_resour ce_path">./config/ehcache-processor1/ehcache.xml</prop>
                <prop key="hibernate.cache.use_structured_entries ">true</prop>
                <prop key="hibernate.generate_statistics">true</prop>
                <prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
            </props>
        </property>
    </bean>

    <bean id="txnManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        <property name="sessionFactory" ref="sessionFactory"/>
    </bean>

    <bean id="hibernateSession" class="com.persist.HibernateSessionImpl">
        <constructor-arg><ref bean="sessionFactory"/></constructor-arg>
        <property name="txnManager" ref="txnManager"/>
    </bean>

    <bean id="hibernateAdmin" class="com.persist.HibernateAdministrationImpl">
        <constructor-arg><ref bean="sessionFactory"/></constructor-arg>
        <constructor-arg><ref bean="&amp;sessionFactory"/></constructor-arg>
    </bean>

    <bean id="systemProcessConfig" class="com.persist.SystemProcessConfiguration">
        <constructor-arg index="0" value="gp"/>
        <constructor-arg index="1" value="gp"/>
    </bean>
</beans>
4

1 に答える 1