Configuring two resource reference files on the same data source

You can configure two resource reference files on the same data source. This allows you to extend the custom properties for the data source to be extended to include two different schema names (currentSQLId on z/OS® or currentSchema name in the custom properties) that can be used to exploit the capabilities of the application server.

About this task

避免困難 避免困難: To use this feature, the application must be configured to use JPA 2.0 specifications. gotcha
When an EntityManager is created, the application server obtains a connection to the database. When you are using a pessimistic transaction, the EntityManager will retain that connection until the EntityManager is closed. When there are two EntityManagers that extend the data source definitions, the openjpa.jdbc.TransactionIsolation property might cause a problem with the transaction. This property can be found in the persistence.xml file in the following entry:
property name="openjpa.jdbc.TransactionIsolation" value="read-committed" 
In order to satisfy this request, Java™ Persistence API (JPA) will obtain a connection and immediately call setTransactionIsolation(READ_COMMITTED). When you have two EntityManagers share a single physical connection to the database, the first EntityManager creates a connection to the database and involves that connection in a transaction. When the second EntityManager creates a connection, it is not able to change the isolation level.
You can avoid this problem by creating two resource reference files in the same data source. You can create the resource references with Rational® Application Developer or by editing the XML files. You will need to make changes to the ejb-jar.xml, ibm-ejb-jar-bnd.xml, ibm-ejb-jar-ext.xml, persistence.xml files.
Note: For IBM® Optim™ PureQuery Runtime, if this is an XA data source you must define a new custom property on the data source where property_name = downgradeHoldCursorsUnderXa and boolean value = true.
See the following sections for information on how to accomplish this:

Procedure


指出主題類型的圖示 作業主題



時間戳記圖示 前次更新: July 9, 2016 11:15
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=tdat_purequeryresref
檔名:tdat_purequeryresref.html