YOUR FEEDBACK
José D'Andrade wrote: "...it may never be released..." Why? "...if Midori isn’t heir to Windows Mi...
AJAXWorld RIA Conference
$300 Savings Expire August 8
Register Today and SAVE!

SYS-CON.TV
TOP THREE LINKS YOU MUST CLICK ON


IBM WebSphere Application Server - WAS for z/OS and DB2
Clearing up some of the conceptual confusion

However, you should be aware of a restriction if you plan to use LTC with DB2. The RMLTs in an LTC don't commit until the transaction boundary defined in LTC is reached. Be careful about lock duration. And if you manipulate the same table using different database connections other than serially reusing the same connection, you can be exposed to database deadlocks (under certain database isolation levels).

Sharing Database Connections
Sharing database connections in WAS for z/OS refers to multiple getConnection calls in the application returning multiple connection handles with the same physical connection (a physical connection corresponds to a DB2 thread). Sharing connections make an application more scalable. It also reduces resource allocation and the chances of deadlocks.

To share database connections, certain conditions have to be met. In WAS for z/OS you can only share a connection scope in a global transaction. However you can serially reuse connections in an LTC. The application's deployment descriptor element Sharing scope has to be set to shareable as shown in Figure 7. The following database connection properties have to be the same:

  • Java Naming and Directory Interface (JNDI) name
  • Resource Authentication setting
  • Principal
  • Connection transaction isolation-level property
  • Connection readOnly, catalog, and typeMap properties
Listing 1 shows two connection handles sharing the same physical connections in a user transaction.

If the resource reference of the Data Source is marked Unshareable, the Connection handles aConn and bConn will have different physical connections. The application can fail if the Data Source doesn't support two-phase commit. Even if the Data Source has two-phase commit support, a deadlock is possible. Using shared connection can avoid this problem because of a strategy that calls for multiple work items to be performed on the same connection.

The use of shareable connections in WAS for z/OS is recommended. However you can still use unshareable connections if your application has to change connection properties. The get/use/close pattern is preferred to share connections. Should you need more information about sharing connections, please refer to the resource.

It's worth pointing out that WAS for z/OS connection manager doesn't reset database connections returned back to the connection pool. The connection returned by the getConnection call will carry the properties set by the application component before it's returned back to the connection pool. For example, a connection is returned back to the connection pool with AutoCommit value FALSE. If the connection is acquired from the connection pool again, the AutoCommit value of the connection is still FALSE rather than TRUE. Initializing the connection before using it can avoid undesired behavior.

Locking and Isolation Level
Transactional locks in DB2 for z/OS are a key component in ensuring database integrity. During database access, transaction isolation determines the nature of the locks to be acquired, which ultimately determines the transactional integrity.

There are four isolation levels in DB2 for z/OS: Repeatable Read (RR), Read Stability (RS), Cursor Stability (CS), and Uncommitted Read (UR). Table 2 shows the DB2 for z/OS and JDBC/SQLJ isolation mapping.

The isolation levels in a Java application are determined by the following precedence order:

  1. The SQL statement WITH clause. This overrides all other forms of setting the isolation level, but offers little flexibility for deploying the same application with different isolation characteristics.
  2. The last setTransactionisolation( ) on the current connection. This method is only available in WAS for z/OS V5.1 (or later). It can't be used for shared connections.
  3. The WAS for z/OS resource reference value. Figure 7 shows how to set the isolation level of a Data Source.
  4. The default for JDBC in WAS for z/OS. The default is (SQL) Read Stability (JDBC) Repeatable Read. This is different from WAS and DB2 for distributed platforms. It can have negative concurrency side effects especially for a DB2 data-sharing environment. Consider the use of isolation CS and MAXROWS 1 with LOCKSIZE ANY to simulate row-level locking.
To maintain the integrity with isolation Cursor Stability (CS), the application must use a mechanism beyond the isolation level to make sure that other transactions can't update data between the time the data is selected and when the target data is updated. This can be done by using either an update cursor or overqualified predicates on an updated statement.

In two-phase commit processing, if the other resources in the transaction don't maintain locks, such as WebSphere MQ, the application should exploit DB2 for z/OS as the last resource enlisted in the transaction to reduce the lock duration.

Conclusion
WAS for z/OS and DB2 for z/OS are a perfect couple for developing high-end business applications. This article discussed the connectivity architectures of the two products and clarified several WAS for z/OS DB2 application development concepts. The best solutions are determined on a case-by-case basis sensitive to specific application needs and infrastructure constraints.

Resources
WebSphere for z/OS information center:

Application Programming and Reference for Java (SC26-9933-04):
About Linfeng Yu
Linfeng Yu is a software architect with ISO, Inc. He has extensive experiences in developing large-scale, complex enterprise-wide architectures and corss platform software development. He has been working with WebSphere for both distributed platform and z/OS since version 3.

YOUR FEEDBACK
WebSphere Journal News Desk wrote: IBM WebSphere Application Server - WAS for z/OS and DB2. Most WebSphere Application Server (WAS) for z/OS customers use DB2 for z/OS as the backend or data store. DB2 for z/OS is a high-performance DBMS, with a strong reputation for handling high-volume data access transactions. Picking the right WAS for z/OS and DB2 Subsystem connectivity architecture can greatly improve the system's performance, availability, scalability, security, and transactional capability.
WEBSPHERE LATEST STORIES . . .
Mike Neil is general manager for virtualization strategy in the Windows Server Division at Microsoft. Mike is focused on the delivery of the Windows virtualization technology, including Windows Server 2008 Hyper-V, Microsoft Hyper-V Server and Virtual PC 2007. Mike also directs the tec...
Unify announced the expansion of its Composer for Lotus Notes solution through a partnership with CASAHL Technology. Partnering with CASAHL extends the Composer solution to include an assessment of the Lotus Notes infrastructure in order to inventory, categorize and analyze the types o...
Two of the biggest launches in Rich Internet Application history took place in 2007/2008 when Adobe launched AIR 1.0 in February '08 and Microsoft launched Silverlight (September '07). At the 6th International AJAXWorld RIA Conference & Expo in October SYS-CON Events is delighted to be...
Reminding people of how its backing was the making of Linux, IBM, to no one's surprise, has thrown its support behind cloud computing, that delicious nexus of every chi-chi buzzword technology currently in vogue: Web 2.0, rich Internet applications, software-as-a-service, SOA, grid com...
IBM claims to have created new species of custom-built, industry-standard, Linux-based rack server for Web 2.0 and Cloud Computing companies with massive data centers and tens of thousands of servers, like online gaming, social networks, search and Internet firms. A relatively limited ...
A standard from OASIS called Web Services for Remote Portlets (WSRP) is used so portlets can be decoupled from a portal. In part one (JDJ, Volume. 13, issue 3) of this article, we introduced the relevant standards and specifications and then demonstrated WSRP's capabilities by consumin...
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE
BREAKING WEBSPHERE NEWS
IBM (NYSE: IBM) today announced that Princess Cruises, a subsidiary of Carnival Corporation (NYSE: C...