Patches item #618523, was opened at 2002-10-04 06:30
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376687&aid=618523&group_id=22866

Category: JBossTX
Group: v3.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Matt Cleveland (groovesoftware)
Assigned to: Nobody/Anonymous (nobody)
Summary: Fixes DataSourceTemplate.xsl for XA

Initial Comment:
The XSLSubDeployer is a nice addition in 3.2.  jboss-
jca.sar uses it to allow connection pool configurations 
through a much simpler configuration file than before.  
Unfortunately the XSL, DTD and Oracle examples are 
broken for XA connection pools.  I also need to set the 
TrackConnectionByTx property and would like to be 
able to do so through the <datasource> configuration so 
I provided a way.  I know everyone is busy, but I would 
sure like to see these committed and available in 3.2 
final :)

This patch includes the following fixes.
1. DataSourceTemplate.xsl: Added support for the 
<user-name> and <password> tags within the <xa-
datasource> element.
2. DataSourceTemplate.xsl: Moved the location of the 
JndiName attribute to be within the correct MBean.  
This corresponds to a configuration change made in 3.2.
3. DataSourceTemplate.xsl: Added an optional <track-
connection-by-tx> element within <xa-datasource>
4. jboss-ds_1_0.dtd: Made corresponding changes to 
the DTD for 1 and 3 above.
5. oracle-xa-ds.xml: Changed the incorrect tag <xa-tx-
datasource> to the correct one <xa-datasource>.
6. oracle-xa-ds.xml: Commented out the XidFactor 
example at the top so that it does not interfere with the 
configuration.
7. oracle-xa-ds.xml: Added <track-connection-by-
tx>true</track-connection-by-tx> because it fixes some 
XA problems with Oracle.
8. oracle-xa-ds.xml: Removed a comment on <user-
name> and <password> that said, "not sure if these 
should be here."
9. oracle-xa-ds.xml: Commented out <xa-datasource-
property name="DatabaseName"> because it is not 
necessary.

Note that #3 above could also be made for <local-tx-
datasource>, but I am not in a position to test it so it 
isn't in this patch.  Also note that some of the other 
example configs likely need #8 above but I am not in a 
position to test these either.

Here are the patches for the 3 files against Branch_3_2:

Index: 
connector/src/resources/stylesheets/DataSourceTempla
te.xsl
=========================================
==========================
RCS 
file: /cvsroot/jboss/jbosscx/src/resources/stylesheets/Da
taSourceTemplate.xsl,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 DataSourceTemplate.xsl
--- 
connector/src/resources/stylesheets/DataSourceTempla
te.xsl  19 Aug 2002 15:14:11 -0000      1.1.2.1
+++ 
connector/src/resources/stylesheets/DataSourceTempla
te.xsl  3 Oct 2002 22:15:58 -0000
@@ -221,6 +221,11 @@
     <mbean 
code="org.jboss.resource.connectionmanager.XATxCon
nectionManager" 
name="jboss.jca:service=XATxCM,name={jndi-name}">
 
       <xsl:apply-templates select="depends" 
mode="anonymous"/>
+      <xsl:if test="track-connection-by-tx">
+        <attribute 
name="TrackConnectionByTx"><xsl:value-of 
select="track-connection-by-tx"/></attribute>
+      </xsl:if>
+
+      <attribute name="JndiName"><xsl:value-of 
select="jndi-name"/></attribute>
 
       <depends optional-attribute-
name="ManagedConnectionFactoryName">
         <!--embedded mbean-->
@@ -228,8 +233,6 @@
           <!--hack-->
           <depends optional-attribute-
name="OldRarDeployment">jboss.jca:service=RARDepl
oyment,name=Minerva JDBC XATransaction 
ResourceAdapter</depends>
 
-          <attribute name="JndiName"><xsl:value-of 
select="jndi-name"/></attribute>
-
           <attribute 
name="ManagedConnectionFactoryProperties">
             <properties>
               <config-property name="XADataSourceClass" 
type="java.lang.String"><xsl:value-of select="xa-
datasource-class"/></config-property>
@@ -242,6 +245,13 @@
                 <config-property 
name="TransactionIsolation" 
type="java.lang.String"><xsl:value-of 
select="transaction-isolation"/></config-property>
               </xsl:if>
 
+              <xsl:if test="user-name">
+                <config-property name="UserName" 
type="java.lang.String"><xsl:value-of select="user-
name"/></config-property>
+              </xsl:if>
+              <xsl:if test="password">
+                <config-property name="Password" 
type="java.lang.String"><xsl:value-of 
select="password"/></config-property>
+              </xsl:if>
+
             </properties>
           </attribute>
         </mbean>
@@ -331,4 +341,4 @@
     </xsl:copy>
   </xsl:template>
 
-</xsl:stylesheet>
\ No newline at end of file
+</xsl:stylesheet>










Index: connector/src/resources/stylesheets/jboss-
ds_1_0.dtd
=========================================
==========================
RCS 
file: /cvsroot/jboss/jbosscx/src/resources/stylesheets/jbo
ss-ds_1_0.dtd,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 jboss-ds_1_0.dtd
--- connector/src/resources/stylesheets/jboss-
ds_1_0.dtd      19 Aug 2002 15:14:11 -0000
        1.1.2.1
+++ connector/src/resources/stylesheets/jboss-
ds_1_0.dtd      3 Oct 2002 22:16:19 -0000
@@ -33,9 +33,11 @@
 <!ELEMENT idle-timeout-minutes (#PCDATA)>
 
 
-<!ELEMENT xa-datasource (jndi-name, database-url, 
xa-datasource-class, xa-datasource-property*, 
transaction-isolation? (application-managed-security | 
security-domain)?, min-pool-size?, max-pool-size?, 
blocking-timeout-millis?, idle-timeout-minutes?)>
+<!ELEMENT xa-datasource (jndi-name, track-
connection-by-tx, database-url, xa-datasource-class, xa-
datasource-property*, transaction-isolation? user-name? 
password? (application-managed-security | security-
domain)?, min-pool-size?, max-pool-size?, blocking-
timeout-millis?, idle-timeout-minutes?)>
 
 <!ELEMENT database-url (#PCDATA)>
+
+<!ELEMENT track-connection-by-tx (#PCDATA)>
 












Index: connector/src/etc/example-config/oracle-xa-
ds.xml
=========================================
==========================
RCS file: /cvsroot/jboss/jbosscx/src/etc/example-
config/oracle-xa-ds.xml,v
retrieving revision 1.1
diff -u -r1.1 oracle-xa-ds.xml
--- connector/src/etc/example-config/oracle-xa-ds.xml
        22 Jul 2002 22:57:24 -0000      1.1
+++ connector/src/etc/example-config/oracle-xa-ds.xml
        3 Oct 2002 22:19:13 -0000
@@ -13,24 +13,32 @@
   <!-- Build jmx-api (build/build.sh all) and view for config 
documentation -->
   <!--  YOU MUST CHANGE THE XidFactoryMBean 
config to this:                 -->
 
+  <!--
   <mbean code="org.jboss.tm.XidFactory" 
         name="jboss:service=XidFactory">
     <attribute name="Pad">true</attribute>
   </mbean>
+  -->
 
   <!-- 
=========================================
=========================== -->
 
 
 <datasources>
-  <xa-tx-datasource>
+  <xa-datasource>
     <jndi-name>OracleXADS</jndi-name>
+    <!-- The following optionally turns on the 
TrackConnectionByTx property
+    of XATxConnectionManager. This property creates a 
1 to 1 mapping of
+    JDBC connections to transactions and prevents a 
connection from
+    participating in more than one transaction at the 
same time.  Setting this
+    to true seems to fix quite a few Oracle XA bugs. -->
+    <track-connection-by-tx>true</track-connection-by-
tx>
+
     <xa-datasource-
class>oracle.jdbc.xa.client.OracleXADataSource</xa-
datasource-class>
     <xa-datasource-property 
name="URL">jdbc:oracle:oci8:@tc</xa-datasource-
property>
-    <xa-datasource-property 
name="DatabaseName">mydatabase</xa-datasource-
property>
+    <!--xa-datasource-property 
name="DatabaseName">mydatabase</xa-datasource-
property-->
 
-<!-- not sure if these should be here-->
     <user-name>x</user-name>
     <password>y</password>
-  </xa-tx-datasource>
+  </xa-datasource>
 
 </datasources>

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376687&aid=618523&group_id=22866


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to