12.1.3. Configuring Databases for XA support

Oracle

XA support has been tested against Oracle version 9i and 10g

Granting SELECT Privilege on V$XATRANS$ & DBA_PENDING_TRANSACTIONS Views

In the event that the TM needs to perform recovery, xa_recover will fail if you do not grant the SELECT privilege to the V$XATRANS$ view for all Oracle accounts that XA applications will use. If the view does not already exist in your Oracle installation then it can be manually loaded using the following SQL script which should be included in your Oracle installation:

$ORACLE_HOME/rdbms/admin/xaview.sql

The example below shows an extract from an Oracle XA Library trace file (for details of how to enable Oracle XA Library tracing in an OpenLink driver see here). Oracle returns error ORA-00942 : table or view does not exist because user scott does not have the necessary SELECT privilege on the V$XATRANS$ view.

ORACLE XA: Version 10.1.0.0.0. RM name = 'Oracle_XA'.
113956.2352:536.536.1:
xaoopen: xa_info=ORACLE_XA+Threads=true+SesTm=60+Acc=P/scott/tiger+DB=DB01BA5BF8+SQLNET=ORCL+DbgFl=0x1+LogDir=c:/,rmid=1,flags=0x0
113956.2352:536.536.1:
xaolgn_help: version#: 168821248 banner: Personal Oracle Database 10g Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
113956.2352:536.536.1:
xaoopen: return 0
113959.2352:536.536.1:
xaorecover: xids=0xf8f8f8, count=10, rmid=1, flags=0x1000000
113959.2352:536.536.1:
ORA-00942: table or view does not exist
113959.2352:536.536.1:
xaorecover: xaofetch rtn -3.
113959.2352:536.536.1:
xaoclose: xa_info=DSN=au49-ora10-carlv;UID=scott;PWD=tiger;+DB=DB01BA5BF8, rmid=1769209857, flags=0x0
113959.2352:536.536.1:
xaoclose: rtn 0

The syntax for adding the grant privilege to the 'scott' user would thus be:

grant select on V$XATRANS$ to scott;

In addtion, the "ORA-00942: table or view does not exist" error also occurs if select privileges are not granted on the DBA_PENDING_TRANSACTIONS view as detailed in this Oracle MetaLink Article, requiring the following command to be executed as a DBA user:

 
GRANT SELECT ON DBA_PENDING_TRANSACTIONS TO PUBLIC
          

Note that the V$XATRANS$ did not exist nor did the DBA_PENDING_TRANSACTIONS view have appropriate select privileges in Unix Oracle installations, although they are included in Windows installations by default.

Informix

XA support has been tested against versions 9.x and 10.x

Enable Database Logging

For XA to be supported with an Informix database, the database must be capable of supporting transactions, which for Informix means the database must have logging enabled.

Useful Links

Sybase

XA support has been tested against Sybase version 12.5.1 and above.

The following instructions need to performed to set up a working XA environment on your database server:

  • Ensure your Syabse Server is licensed for Distributed Transaction Management. This can be checked by executing the following query against you Sybase Server:

select license_enabled('ASE_DTM') 

The query will return "1", if you have the ASE_DTM license installed.

  • Run "sp_configure 'enable DTM',1" , via isql to enable transactions.

  • Run "sp_configure 'enable xact coordination',1" , via isql

  • Run "grant role dtm_tm_role to USER_NAME" .

  • To prevent deadlocks when running transactions, enable row level lock by default, by running "sp_configure 'lock scheme',0,datarows" via isql.

. Note, you must restart Adaptive Server for this changes to take effect.

Setting the Timeout for Detached Transactions

On the Sybase server, you can set the dtm detach timeout period, which sets the amount of time (in minutes) that a distributed transaction branch can remain in the detached state (without an associated execution thread). After this period, the DBMS automatically rolls back the transaction. The dtm detach timeout period applies to all transactions on the database server. It cannot be set for each transaction. For example, to automatically rollback transactions after being detached for 10 minutes, use the following command:

"sp_configure 'dtm detach timeout period', 10"

You should set the dtm detach timeout period higher than the transaction timeout to prevent the database server from rolling back the transaction before the transaction times out.

SQLServer

XA support was tested against the following Microsoft SQLServer versions:

MSSQL 6.5 RTM (WinNt4 Sp3)

MSSQL 7.0EE SP4 (Win2k AdvSrv Sp3)

MSSQL 2000 SP3a (Win2k Sp3)

Before using the Microsoft SQLServer XA features you must install and register the Microsoft SQLServer extented stored procedures, for this :

1) copy xp_oplxa.dll ( xp_oplxa65.dll for MSSQL 6.5) to the MSSQLServer_Root/binn directory

2) execute the command :

isql.exe -Usa -Psa_pwd -ig:xp_oplxa.sql

or

isql.exe -Usa -Psa_pwd -ig:xp_oplxa65.sql (for MSSQL 6.5)

Ingres II

XA is supported with IngresII version 2.0 and higher and Ingres II DBMS does not require any additional configuration for XA support to be enabled.

The Ingres II XA support was tested against the following versions:

IngresII v2.0

IngresII v2.6

IngresII v3.0 (Open release)