Show Table of Contents
5.3. Hibernate エンタープライズ設定
hibernate.cfg.xmlファイルには以下の設定アイテムが含まれます。これらを変更し、他のデータベースやアプリケーションサービスをサポートします。
<!-- sql dialect -->
<property name="hibernate.dialect">
org.hibernate.dialect.HSQLDialect
</property>
<property name="hibernate.cache.provider_class">
org.hibernate.cache.HashtableCacheProvider
</property>
<!-- DataSource properties (begin) -->
<property name="hibernate.connection.datasource">
java:comp/env/jdbc/JbpmDataSource
</property>
<!-- DataSource properties (end) -->
<!-- JTA transaction properties (begin) -->
<property name="hibernate.transaction.factory_class">
org.hibernate.transaction.JTATransactionFactory
</property>
<property name="hibernate.transaction.manager_lookup_class">
org.hibernate.transaction.JBossTransactionManagerLookup
</property>
<!-- JTA transaction properties (end) -->
<!-- CMT transaction properties (begin) ===
<property name="hibernate.transaction.factory_class">
org.hibernate.transaction.CMTTransactionFactory
</property>
<property name="hibernate.transaction.manager_lookup_class">
org.hibernate.transaction.JBossTransactionManagerLookup
</property>
==== CMT transaction properties (end) -->hibernate.dialect 設定をお使いのデータベース管理システムに適したものに置き換えます (詳細はhttp://www.hibernate.org/hib_docs/v3/reference/en/html/session-configuration.html#configuration-optional-dialectsを参照してください)。
HashtableCacheProvider は、他の対応キャッシュプロバイダーで置き換えることが可能です (詳細は http://www.hibernate.org/hib_docs/v3/reference/en/html/performance.html#performance-cache を参照してください)。
デフォルトで、JBPMは
JTATransactionFactory を使うよう設定されています。既存のトランザクションがある場合、JTAトランザクションファクトリはこれを使いますが、ない場合は新規トランザクションを作成します。JBPM エンタープライズ bean はコンテナーへトランザクション管理を委譲するよう設定されています。ただし、(Web アプリケーションなど) アクティブなトランザクションがないコンテキストで JBPM API が使われている場合、自動で起動します。
Container-Managed Transactions (CMT)の利用時に予定外にトランザクションが作成されないように、
CMTTransactionFactoryへ切り替えます。この設定により、Hibernate は常に既存のトランザクションを検索し、何も見つからなかった場合は問題を報告します。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.