2017-11-20 4 views

答えて

4

はい、OpenLibertyでは、のみJPAコンテナ統合コードを提供jpaContainer-2.1機能を有し、ユーザが自分のJPA 2.1準拠の実装(すなわちEclipseLinkのまたは休止状態)に接続することを可能にします。

特にHibernateの場合、jpaContainer-2.1機能は、HibernateとLibertyのトランザクションマネージャを統合します。
Deploying a JPA application to Liberty

あなたはserver.xmlで必要となる基本的な設定は以下の通りです:あなたは設定例を含めて、ここに完全なドキュメントを見つけることができますLibertyJtaPlatform

を参照してください

<featureManager> 
    <feature>jpaContainer-2.1</feature> 
    <feature>bells-1.0</feature> 
     ...  
</featureManager>  

<!-- Making a 'bell' for the library will register any META-INF/services in the referenced library with the Liberty runtime --> 
<bell libraryRef="hibernate"/> 

<!-- Include all of the hibernate jars in a shared lib --> 
<library id="hibernate"> 
    <fileset dir="${server.config.dir}/hibernate/" includes="*.jar"/> 
</library> 

<!-- OPTIONAL: If you wish to directly reference hibernate APIs in your app, you will need to configure a shared library classloader --> 
<application location="myApp.war"> 
    <classloader commonLibraryRef="hibernate"/> 
</application> 
+0

おかげでアンディ、唯一のもの私はまだHibernateの第2レベルのキャッシュの設定が不明です。通常これはInfinispan、またはPayara - nazelcastの場合に行われます。これはOpenLibertyでどのように行われますか? –

+0

@HristoStoyanov私はHibernateのセッションファクトリキャッシュを以前に設定していませんでしたが、もし推測しなければならなかった...あなたがOpenLibertyで見つけたとは思わないので、独自の実装(例えばEhcache)を提供する必要があります。次に、サーバの設定で共有ライブラリに追加し、Hibernateが必要とする持続性プロパティを設定します。 –

+0

ありがとう、私はそのようなことをしなければならないと考えた –

関連する問題