The Liberty profile server can be enabled to interact with DB2® by using the JDBC Type 2 driver
implementation on z/OS®.
About this task
When using an RRS capable resource such as DB2 you have the following optional
configurations:
- You can enable the server to automatically
delete resource manager names from the Resource and Recovery Services
(RRS) RM.DATA logstream when the server is stopped. This configuration
is optional, but if enabled it prevents resource manager names from
accumulating in the logstream. To enable automatic RM name deletion,
configure Resource Access Control Facility (RACF®) to allow the server to call the ATRSRV
macro. To enable automatic RM name deletion, the user ID that the
Liberty profile server runs under must have ALTER access in the FACILITY
class to either:
- MVSADMIN.RRS.COMMANDS.gname.sysname resource, to access to a specific
logging group name (gname) and system (sysname)
- MVSADMIN.RRS.COMMANDS.* resource to allow access to all systems
and logging group names
- You can define the RM.METADATA logstream
to log data that assists debugging. The user ID that the Liberty profile
server runs under must have ALTER access in the FACILITY class as
described.
Note: For more information about the ATRSRV macro, setting the
appropriate RACF permission,
and how to define the RM.METADATA logstream, refer to the MVS Programming: Resource Recovery publication
relevant to your system's z/OS level.
- You can control the time to wait for transactions
actively using native contexts to complete when the server is stopped
or the zosTransaction-1.0 feature is no longer needed.
This can be done by using nativeTransactionManager configuration
element and the shutdownTimeout attribute.
- You can restrict user authority for performing
any transactional work that involves RRS capable resources, for example DB2 T2, on a particular server.
This can be done by using nativeTransactionManager configuration
element, and the resourceManagerNamePrefix attribute.
Note: The resourceManagerNamePrefix attribute
specifies a 1 to 8 alphanumeric (A-Z, a-z, 0-9) and national (@,#,$)
only character prefix, to be used as part of the server generated
resource manager name that is registered with RRS. The prefix "DEFAULT"
is a reserved prefix that identifies a default server configuration
and should not be used for securing server access. If the configured
prefix does not follow the name, length, and character requirements,
the DEFAULT prefix name is used. The prefix is intended for system
administrators to enable only authorized users to perform transactional
work (normal and recovery) involving RRS capable resources. For example DB2 T2, on the server where the
prefix was configured. System administrators must define a BBG.RMNAME.<PREFIX>.RRS
resource under the SERVER class, and give the required users READ
authority.
These examples describe the optional configuration:
Server.xml
element and attribute definition:
<nativeTransactionManager shutdownTimeout="20s" resourceManagerNamePrefix="PROD1"/>
RACF resource definition and user
authorization:
RDEF SERVER BBG.RMNAME.PROD1.RRS UACC(NONE)
PERMIT BBG.RMNAME.PROD1.RRS CLASS(SERVER) ACCESS(READ) ID(PROD1USR)
SETR RACLIST(SERVER) GENERIC(SERVER) REFR
For more
information, see
Liberty profile: Configuration elements in the server.xml file
Procedure
- Update the Liberty profile server's server.xml configuration
file. Add the zosTransaction-1.0 feature subelement
to the featureManager element:
<featureManager>
<feature>zosTransaction-1.0</feature>
</featureManager>
Specifying this feature enables the application server to synchronize and appropriately manage transactional activity between the Resource Recovery Services (RRS), the transaction manager of the application server, and the resource manager. So, work without
having configured the zosTransaction-1.0 feature
is not allowed.
- Add the resource's (DB2)
native libraries to the resource's <library> configuration
element: The <library> element in
the example should show:
<library id ="DB2T2LibRef">
<fileset dir="<YOUR DB2 T2 LIBRARY PATHS>" />
<fileset dir="<YOUR DB2 T2 NATIVE LIBRARY PATHS>" />
</library>
Example
This example describes how to configure your application,
jdbc driver, library, fileset, and data source elements, in the server.xml
configuration file.
<application type="war" id="db2T2TxWar" name="db2T2TxWar"
location="/u/user1/wlp/usr/servers/defaultServer/dropins/db2T2Tx.war" />
<jdbcDriver id="DB2T2" libraryRef="DB2T2LibRef"/>
<library id="DB2T2LibRef">
<fileset dir="/db2v10/jcc/classes" />
<fileset dir="/db2v10/jcc/lib" />
</library>
<dataSource id="jdbc/DB2T2" jndiName="jdbc/DB2T2" jdbcDriverRef="DB2T2">
<properties.db2.jcc driverType="2" databaseName="LOC1" />
</dataSource>