0

Websphereサーバーと一緒にspring+hibenateを使用しているときに、この例外が発生します

org.hibernate.TransactionException: Could not register synchronization

Spring構成ファイルのHibernateプロパティは

<props>
    <prop key="hibernate.dialect">org.hibernate.dialect.DB2Dialect</prop>
    <prop key="hibernate.generate_statistics">true</prop>
    <prop key="hibernate.show_sql">false</prop>
    <prop key="hibernate.connection.datasource">jdbc/jndiName</prop>
    <prop key="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</prop>
    <prop key="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</prop>

    <prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
    <prop key="hibernate.connection.aggressive_release">false</prop>
    <prop key="hibernate.connection.release_mode">after_transaction</prop>
    <prop key="hibernate.connection.autocommit">true</prop>
    <prop key="hibernate.connection.pool_size">5</prop>
    <prop key="hibernate.current_session_context_class">thread</prop>
    <prop key="hibernate.cache.use_query_cache">true</prop>
    <prop key="hibernate.cache.use_second_level_cache">true</prop>  
</props>
4

1 に答える 1

0

WebSphere自体が、データソースのすべてのプーリングとキャッシュレベルを処理します。JDBC関連のすべての構成は、WebSphere管理コンソールを介して実行できます。だから書く

<props>
    <prop key="hibernate.dialect">org.hibernate.dialect.DB2Dialect</prop>
    <prop key="hibernate.generate_statistics">true</prop>
    <prop key="hibernate.show_sql">false</prop>
    <prop key="hibernate.connection.datasource">jdbc/jndiName</prop>
    <prop key="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</prop>
    <prop key="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</prop>
</props>

春には十分です。

于 2012-11-12T07:58:20.740 に答える