Adding Oracle's XA data source support in Jboss

Source: Internet
Author: User


This information is too small and eventually found on an IBM Web page .

    • First, let Oracle turn on the XA feature, which can be implemented in the following steps:

1) in SQLPLUS(? ? Make sure you use this tool . ? ? ) , log in to your database with Oracle's system administrator user Sysoper or SYSDBA (because the user can get the most access).

2) found <oracle installation directory >\javavm\install directory, two scripts Initxa.sql and   initjvm.sql to copy the full path they are in to the logged-in Sqlplus environment (note: The directory delimiter under Windows should be changed from "\" to "/") to execute the script. Format such as: @d:/initxa.sql.  

Note : When performing ? ? These two scripts may fail when you need to modify the system parameters of two Oracle (files are placed in the <oracle mount directory >\database\init< instance sid> . Ora),? ?

Parameter name Minimum value

After you modify it, you need to restart the Oracle instance to take effect.

3) Set permissions for the current database access User:

Grant SELECT on Dba_pending_transactions to < current user >grant Select on pending_trans$ to < current user >; Grant SELECT on dba_2pc_pending to < current user >;grant execute on DBMS_XA to < current user >; --(If you are using Oracle or a later version of JDBC driver)

4) Restart the data instance.

5) log in to the database with the required operations user to verify that the permissions are in effect.

    • Settings for JBOSS instance side

      1) Copy the JDBC Driver Library (. jar) file for the corresponding version of the database into the Lib directory of the instance.

      2) Copy an Oracle XA configuration from the XA sample template from JBoss to the corresponding data source configuration file

    • Such as:

  <xa-datasource>    <jndi-name>jdbc/rrr</jndi-name>     <xa-datasource-class>oracle.jdbc.xa.client.oraclexadatasource</xa-datasource-class ><xa-datasource-property name= "URL" >jdbc:oracle:thin: @xxxx: Xxx:333</xa-datasource-property >    <xa-datasource-property name= "User" >33</xa-datasource-property>     <xa-datasource-property name= "Password" >22</xa-datasource-property>     <min-pool-size>5</min-pool-size>    <max-pool-size >20</max-pool-size>    <!-- corresponding type-mapping in  the standardjbosscmp-jdbc.xml  (optional)  -->    <metadata>     <type-mapping>Oracle10g</type-mapping>    </metadata>   </xa-datasoUrce> 

    • Summary: The XA feature of Oracle is the use of the Java Driver Library to invoke transaction initiation, transaction rollback, transaction commit, and transaction end stored procedure methods (see The code for the driver package: oracle.jdbc.xa.oraclexaresource--, which is the class method of the Oracle native JVM.

    • Resources:

      1) Oracle Official gives instructions on several stored procedures in this package

      2) Oracle Official gives instructions on several stored procedures in this package 2

      3) The most reliable solution offered by IBM

      4) solutions to the same problems that others ask on the IBM Technology website

5) How these several procedures are called, Burleson Uncle to give you guidance under!

Adding Oracle's XA data source support in Jboss

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

Tags Index: