WAS v8.5 > Administer applications and their environment > Welcome to administering Data access resources > Administer data access applications > Configure a JDBC provider and data source > Use the DB2 Universal JDBC Driver to access DB2 for z/OS

Configure two resource reference files on the same data source

We 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.

When an EntityManager is created, the application server obtains a connection to the database. When 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:

To satisfy this request, Java Persistence API (JPA) will obtain a connection and immediately call setTransactionIsolation(READ_COMMITTED). When we 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.

We can avoid this problem by creating two resource reference files in the same data source. We 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.

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:


Related


Extend DB2 data source definitions at the application level


+

Search Tips   |   Advanced Search