Previous Contents Index Next |
iPlanet Application Server Administrator's Guide |
Chapter 9 Administering Transactions
This chapter describes the tasks and conceptual information necessary for administering transactions using the iPlanet Application Server Administration Tool (iASAT)The following topics are included in this chapter:
About the Transaction Manager
About the Transaction Manager
The transaction manager is installed with each instance of iPlanet Application Server to coordinate global transactions within a Java Server (KJS) process. Global transactions are a set of related operations that must be executed as a unit, though each operation may run in a different process.You can use global transactions to update a database that uses one or more Enterprise Java Beans (EJBs) running concurrently for the same global transaction, from within one or more KJS processes. This occurs when an EJB triggers another EJB to run and they both participate in the same transaction. You can also update multiple databases that are distributed over different geographic locations or update multiple databases of different types (such as Oracle and Sybase).The transaction manager runs within a KJS process.
New Features
Beginning with iPlanet Application Server, Enterprise Edition 6.5 release, the bundled transaction manager is based on the Java Transaction Service Reference Implementation (JTS RI) with suitable modifications for production environments.A local transaction manager has also been added for optimization of applications that use local transactions.
The datasource manager now has enhanced functionality and provides support for XADataSource, PooledDataSource and DriverManager. New Connection Pooling infrastructure has been implemented to support pooling of XA connections and Pooled connections.
The following new features have been added to the transaction manager:
Flexibility to run both global and local transactions at the same time.
The new transaction manager has better administration control, monitoring and tracing facility. The iPlanet Application Server Administration Tool has been enhanced significantly to support administration and monitoring features.Provision for the user to specify the transaction type at three levels:
Support for recovery.
- iPlanet Application Server determines the transaction type for a particular component/application by initially referring under the package name, followed by the component <classdef\<guid>, and finally for instance wide value under <CCSO\TXNMGR> in the registry.
Tip You can achieve better performance by specifying the transaction type at the component level.
- When iPlanet Application Server starts up, it queries for all pending transactions from all databases used by datasources registered in the registry, and performs recovery. Recovery can also be disabled.
Administering Distributed Transactions from iASAT
You can administer transactions using the Transaction menu option of iPlanet Application Server Administration Tool.This section describes the following topics:
About the Transaction Window
Viewing Transactions Per Server
Configuring Transactions Per Server
Administering Transactions Per Process
About the Transaction Window
The left pane of the Transaction window displays a tree of nodes as shown in the following illustration:
Figure 9-1   
Transaction manager configuration tab
The top level of the tree lists which servers are registered with iASAT. The second level, below each registered server name, displays one or more process nodes. These nodes indicate which processes are running on each registered server. Only Java Server (KJS) processes appear in the tree because only KJS processes support transactions.
The KJS process is displayed alongwith the port number (for example,10819) and the ORB port (for example, 10920) used to connect to the JMS Listener.
Configuring Transactions Per Server
When you select an iPlanet Application Server instance and click Transactions on the menu bar, the global properties for that server instance is displayed. All KJS instances share the properties of iPlanet Application Server except for their identity (Engine Id, port number, etc.). Changes made in this Configuration dialog box will affect all transactions running on that server.To change transaction settings for an application server, click a registered server in the left pane of the Transaction window. The Configuration tab appears in the right pane as shown here:
Figure 9-2    Transaction properties displayed for a server instance
The following options can be configured:
Transaction Type
Time out
- You can set the transaction type to either local or global.
- When global transactions are enabled, transactions can span across multiple heterogeneous databases and processes.
Wait Interval
- Set this time (in seconds) to rollback a transaction if it's not completed in the stipulated time. This would be helpful in cases where a transaction process was started (for example a stateful session bean), but a bug in the application design prevented its completion.
Log Directory
- The Wait Interval specifies the time (in seconds) iPlanet Application Server will wait before clearing stale or corrupt transactions.
Viewing Transactions Per Server
To view details about a transaction, click the Transaction Manager tab. The Transactions Manager dialog box appears with detailed information on the status of various transactions in progress.
The entries in the detailed view are explained below:
Administering Transactions Per Server
Multiple entries can be selected at a time to control the active transactions. At the bottom of the dialogue box are options which will enable you to control the transactions that are in progress.
Mark for Rollback
Update
- Use the Mark for Rollback option to roll back an active transaction. Select the required transaction and click Mark for Rollback.
- You can also roll back multiple transactions at the same time by selecting them while holding the Shift key down, and pressing Mark for Rollback.
Note Sometimes when you roll back a transaction, you may get a message, "Transaction does not exist". This is because the transaction may have completed before your command got executed.
Administering Transactions Per Process
You can administer each transaction process connected to a particular KJS engine running under the desired iPlanet Application Server instance. This option allows allows you granular control of transactions running on iPlanet Application Server.
Viewing Transactions on a Selected Process
To view the status of transactions on a particular KJS engine, select the required engine in the left pane. The transactions running on that engine will be displayed in the right pane.
Figure 9-3   
Transaction properties displayed for a particular KJS engine.
The entries in the detailed view are explained below:
Administering Transactions Per Process
Select the application server instance in the left pane and then click on the Transactions icon on the menu bar. You will get the dialog box as shown in Figure 9-3.Multiple entries can be selected at a time to control the active transactions. At the bottom of the dialogue box are options which will enable you to control the transactions that are in progress.
Mark for Rollback
Freeze Transactions
- Use the Mark for Rollback option to roll back an active transaction. Select the required transaction and click Mark for Rollback.
- You can also roll back multiple transactions at the same time by selecting them and pressing Mark for Rollback.
Unfreeze Transactions
- Use the Freeze Transactions option to temporarily stop all active transactions. You will be prompted to confirm whether you want to go ahead and stop all transactions.
- Press OK if you want to go ahead or Cancel to exit the Freeze option.
- When the Freeze Transactions option is used, no new transactions will start and existing transactions will be frozen at the next logical step.
Update
- Use Unfreeze Transactions to resume all transactions that were stopped by the Freeze command.
- You will be prompted for confirmation. Press OK to Unfreeze all existing transactions.
Monitoring Transactions
The monitoring framework enables the display of various properties related to the module. These could be used to get a view of the system's internals to help fine tune application parameters, detect bottlenecks, and check the health of the application.JTS provides more advanced monitoring facility for transactions. All results are displayed by the admin tool. It provides following features:
Displays all active transactions with the following information:
Transaction ID
Displays TPM for both local and global transactions.Component that started the transaction,
Status (prepared, running, rollbacked, committing)
Transaction type (global/local)
Displays average time taken for each transaction (both global and local). For the sample time, average time for transaction, local transaction and global transaction are displayed.
- A value called sample time is displayed and is editable by the user. The sample time would be used to compute the TPM. And it would be displayed. In addition to a total count, there are two other values- one for local, and one for global.
Configuration Parameters
Configuration parameters provided for transaction manager are as follows:
All keys can be found in registry under SOFTWARE/iPlanet/ApplicationServer/6.5/CCS0/TXNMGR
Resolving In-Doubt Transactions
Occasionally, particularly when a Java Server (KJS) process quits suddenly, you may find "hanging" or in-doubt transactions. For Microsoft SQL Server, in order to manually commit or rollback in-doubt transactions, use DTC administrator control. This is also known as DAC. dac.exe is found in the WINNT\SYSTEM32\ directory and is installed with DTC.After starting DAC, perform the following steps to manually commit or rollback in-doubt transactions:
From the iASAT toolbar, click Transactions to open the Transactions window.
For Oracle resource managers, if you encounter a "lock held by distributed transaction" error, you must connect to the database and rollback the global transaction explicitly. To do so, perform the following steps:Click the Transaction Manager tab.
Select the transaction that you want to force and click Details.
Find out the local transaction ID that corresponds to the transaction by looking at dba_2pc_pending, which has all the details about pending global transactions.
For Sybase resource managers, if you encounter a "lock held by distributed transaction" error, you must connect to the database and rollback the global transaction explicitly. To do so, perform the following steps:Rollback the transaction by typing
Find out the local transaction ID that corresponds to the transaction by running sp_xa_scan_xact, which supplies a list of transaction identifiers.
Use sp_finish_xact with a transaction identifier and a stat (either commit or rollback) to force the branch to complete.
Previous Contents Index Next
Copyright © 2002 Sun Microsystems, Inc. All rights reserved.
Last Updated March 06, 2002