Note: Source code for XA switch modules is not installed with 
		
Server Enterprise Edition or 
		  Studio Enterprise Edition Test Server. 
	 
 
 
	  
	  
		Studio Enterprise Edition includes the source code for switch modules for Oracle, IBM DB2, XDB, SQL Server, a generic one-phase ODBC switch module, a two-phase MQSeries switch module, and the additional switch modules for using with JES-initiated transactions in the 
		  %ProgramFiles(x86)%\Micro Focus\Studio Enterprise Edition x.x\base\source\enterpriseserver\xa directory. 
		
 
		With the exception of the two-phase MQSeries switch module, you must build each switch module in your development environment, and then copy it to your deployment server. The files are: 
		
 
			  
			  
			  
				 
				  | ESORAXA.CBL | Oracle | 
 
				 
				  | ESDB2XA.CBL | IBM DB2 | 
 
				 
				  | ESMSSQL.CBL | SQL Server | 
 
				 
				  | ESODBCXA.CBL | Generic one-phase commit for ODBC | 
 
				 
				  | ESMQXA.DLL | MQSeries1 | 
 
				 
				  | ESORAOPC.pco | JES-initiated transactions connecting to Oracle data sources | 
 
				 
				  | ESDB2OPC.CBL | JES-initiated transactions connecting to IBM DB2 data sources | 
 
				 
				  | ESXDBXA.CBL | XDB | 
 
				 
				  | ESXDBOPC.CBL | JES-initiated transactions connecting to XDB Server | 
 
				 
				  | 1 The MQSeries module provided is a built module, not a source code file. It is available in both your development and deployment environments. For more information, see 
					 The MQSeries XA Switch later in this topic. | 
 
			 
 
		  
 
		   
			 - SQL Server Requirements 
			 
- The SQL Server module provides two-phase commit support utilizing the Microsoft Distributed Transaction Server (MS DTC), and ensures that any database connections made using this switch module all participate in a single XA transaction. MSDTC must be running on both the client machine, and also the machine(s) where SQL Server is hosted. 
				 
			 
- SQL Server and ODBC Requirements 
			 
-  Some OpenESQL directives are process-based, and typically need to be set in within the code of the program that makes the database connection. If you are executing services under Enterprise Server that are deployed as container-managed applications, or if you are invoking JES-initiated transactions using IKJEFT01, these directives must be specified when compiling the XA switch module, rather then when compiling your program source. 
			 
- ODBC Limitations 
			 
- The ODBC module supports only a one-phase commit, and hence: 
				 
				  - Cannot be used in conjunction with other resource managers that use this module because, within a given region, the generic ODBC one-phase commit module supports only one active Resource Manager at a time. 
				  
- Can only be used for a single database connection; multiple data source connections are not supported 
				  
 
-  SQL Server and Generic One-phase Commit for ODBC Limitations 
			 
- When using the SQL Server and Generic one-phase commit for ODBC switch modules, the following SQL operations are not supported in the source for your deployed container-managed service: 
				 
				  - CONNECT 
				  
- DISCONNECT 
				  
- BEGIN TRANSACTION 
				  
- COMMIT 
				  
- ROLLBACK 
				  
 
 
 
	  
	  
	  
	  
		 
		  - ODBC Requirements 
		  
-  Some OpenESQL directives are process-based, and typically need to be set in within the code of the program that makes the database connection. If you are executing services under Enterprise Server that are deployed as container-managed applications, or if you are invoking JES-initiated transactions using IKJEFT01, these directives must be specified when compiling the XA switch module, rather then when compiling your program source. 
		  
- ODBC Limitations 
		  
- The ODBC module supports only a one-phase commit, and hence: 
			  
				- Cannot be used in conjunction with other resource managers that use this module because, within a given region, the generic ODBC one-phase commit module supports only one active Resource Manager at a time. 
				
- Can only be used for a single database connection; multiple data source connections are not supported 
				
 
- Additional Oracle Resources 
		  
- For more information on using the Oracle XA switch module, including the Open String definition and details of supported SQL operations, see the following: 
			  
				- The 
				  Database Access Support topic for Third-party Software in the 
				  Start Here section of this documentation. 
				
- The 
				  Developing Applications with Oracle XA help topic available in the Oracle RDBMS documentation. 
				
 
- Additional IBM DB2 Resources 
		  
- For more information on using the IBM DB2 XA switch module, including the Open String definition and details of supported SQL operations, see the following: 
			  
				- The 
				  Database Access Support topic for Third-party Software in the 
				  Start Here section of this documentation. 
				
- The 
				  Transaction Managers help topic available in the IBM RDBMS documentation. 
				
- DB2 9.1 - The 
				  X/Open XA Interface programming considerations help topic available in the IBM RDBMS documentation. 
				
 
To build a switch module
 
		 
		As well as the switch module sources, the directory contains the 
		  build.bat batch file that you can use to build the switch module you need. 
		
 
		 
		 
		  - For 32-bit applications: 
			  
				- Open a 
				  Net Express command prompt, 32-bit. 
				
- Change to the 
				   
		  %ProgramFiles(x86)%\Micro Focus\Studio Enterprise Edition x.x\Base\SOURCE\ENTERPRISESERVER\XA directory (default location). 
				
- Enter 
				  build 
					 switch-module 
				
 
- For 64-bit applications: 
			  
				- Open a 
				  Net Express command prompt, 64-bit. 
				
- Change to the 
				   
		  %ProgramFiles(x86)%\Micro Focus\Studio Enterprise Edition x.x\Base\SOURCE\ENTERPRISESERVER\XA directory (default location). 
				
- Enter 
				  build 
					 switch-module 
				
 
where 
		  
switch-module is the type of module you want to build, as follows: 
		
 
			  
				 
				  | Value of 
					 switch-module | Module type | 
 
			  
				 
				  | ora10 | Oracle 10 databases | 
 
				 
				  | ora11 | Oracle 11 databases | 
 
				 
				 
				  | db2 | IBM DB2 Important: Before building this switch module, ensure your LIB environment variable contains the path to your DB2 LIB directory. 
					  | 
 
				 
				  | odbc | Generic one-phase commit for ODBC | 
 
				 
				  | xdb | XDB | 
 
			 
 
		  
You must also build these additional modules if you need to connect to resources from JES-initiated tasks over IKJEFT01. These modules must be loaded by the main switch module; therefore include the full path to any additional switch modules in your system's PATH environment variable: 
		
 
				 
				  | Value of 
					 switch-module | Module type | 
 
			  
				 
				  | ora1pc | Oracle databases | 
 
				 
				  | db21pc 
					 db2_database_alias [db2_userid db2_password | IBM DB2. Parameters:  
						 
						  db2_database_alias 
						  The database alias cataloged to the DB2 client on the machine where Enterprise Server is running 
						  db2_userid db2_password 
						  The user ID and password for connecting to DB2; required only if different from the user ID and password for the user currently logged in 
						   | 
 
				 
				  | odbc | Generic one-phase commit for ODBC1 | 
 
				 
				  | xdb1pc | XDB | 
 
				 
			 
 
		  
Important: If you are running 
		  
Server Enterprise Edition, build the required switch module in 
		  
Studio Enterprise Edition, and make it available for use with the standalone 
		  
Server Enterprise Edition. 
		   
		
 
 
	 The MQSeries XA Switch
 
		 
		The ESMQXA module is provided as part of the product and does not need to be built. The filename for the built module is 
		  esmqxa.dll. 
		
 
		By default, the ESMQXA module operates in two-phase commit mode. You can set the environment variable ES_MQ_1PC to Yes or True in order for the module to operate in one-phase commit mode, but you should only do this if advised to by Micro Focus. 
		
 
		 
		Important:  Set the MQ Connection in one of these two places: 
		  
 
			 - XA Resource Manager 
			 
- System Initialization Table (SIT) 
			 
Do not set it in both. Doing so results in two connections between the 
		  
Server Enterprise Edition region and the MQ Queue Manager. Only one is required.