Thanks for your assistance.

Bruce here is the oracle-xa-ds.xml.  It is stock from JBoss
doc/examples/jca directory with my site-specific settings enabled.  

datasources>
  <xa-datasource>
    <jndi-name>AT4ServerDS</jndi-name>
    <track-connection-by-tx>true</track-connection-by-tx>
    <isSameRM-override-value>false</isSameRM-override-value>
   
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
    <xa-datasource-property
name="URL">jdbc:oracle:oci8:@beer</xa-datasource-property>
    <xa-datasource-property
name="User">attempt4</xa-datasource-property>
    <xa-datasource-property
name="Password">attempt4</xa-datasource-property>
    <!-- Uses the pingDatabase method to check a connection is still
valid before handing it out from the pool -->
   
<valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker
    <!-- Checks the Oracle error codes and messages for fatal errors -->
   
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
    <!-- Oracles XA datasource cannot reuse a connection outside a
transaction once enlisted in a global transaction and vice-versa --   
<no-tx-separate-pools/>
  </xa-datasource>
                                                                                       
                                               
  <idle-timeout-minutes>15</idle-timeout-minutes>
                                                                                       
                                               
  <mbean
code="org.jboss.resource.adapter.jdbc.xa.oracle.OracleXAExceptionFormatter"
         name="jboss.jca:service=OracleXAExceptionFormatter">
    <depends
optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends>
  </mbean>
                                                                                       
                                               
</datasources>


Also, the <server_dir>/conf/jboss-service.xml has changed from stock
jboss by adding the attribute Pad=true.

   <mbean code="org.jboss.tm.XidFactory"
      name="jboss:service=XidFactory">
      <attribute name="Pad">true</attribute>
   </mbean>

Donnie

On Thu, 2004-06-17 at 22:44, Bruce Snyder wrote:
> Donnie Armstrong wrote:
> 
> > Werner thanks for your help.
> > 
> > My environment JBoss 3.2.3 + Oracle 10g + Oracle XA + Castor 0.9.5.3
> > 
> > I would like the database.xml file to use the JNDI datasource instead of
> > stand-alone JDBC connection.  When I invoke
> > qry.execute(Database.ReadOnly), I receive an exception. I am at a loss
> > as how to tell Castor to ignore setAutoCommit() on the connection.
> > 
> > The below code works fine if i change database.xml to use stand-alone
> > jdbc.  
> > 
> > database.xml =>
> >     <database name="at4" engine="oracle">
> >         <jndi name="java:/AT4ServerDS" />
> >         <mapping href="conf/castor_mapping.xml" />
> >     </database>
> > 
> > Code snippet =>
> > 
> > try {
> >    // construct JDO adapter
> >    JDO jdo = new JDO("at4");
> >             
> >    // load database file
> >   
> > jdo.setConfiguration(getClass().getClassLoader().getResource(dbFileName).toString());
> >             
> >             // aquire database handle
> >             Database db = jdo.getDatabase();
> > 
> >             // initialize castor transaction
> >             db.begin();
> > 
> >             // initialize query
> >             OQLQuery qry = db.getOQLQuery("SELECT p FROM
> > com.attempt4.framework.oracle.DatasetLayoutBean p where p.dataSetName =
> > $1");
> > 
> >             // bind parameters
> >             qry.bind(datasetName);
> > 
> >             // execute query (read-only)
> >             QueryResults results = qry.execute(Database.ReadOnly);
> > 
> > 
> > Stack Trace =>
> > ERROR 11:32:39,877 [STDERR] java.sql.SQLException: You cannot set
> > autocommit during a managed transaction!
> > ERROR 11:32:39,878 [STDERR]         at
> > org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.setJdbcAutoCommit(BaseWrapperManagedConnection.java:440)
> > ERROR 11:32:39,878 [STDERR]         at
> > org.jboss.resource.adapter.jdbc.WrappedConnection.setAutoCommit(WrappedConnection.java:446)
> > ERROR 11:32:39,879 [STDERR]         at
> > org.exolab.castor.jdo.engine.TransactionContextImpl.getConnection(TransactionContextImpl.java:211)
> 
> Donnie,
> 
> The exception above makes me think that you've got the DataSource 
> configured improperly in JBoss. Please post your *-ds.xml file so that 
> we can see how the DataSource is configured.
> 
> Bruce



----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

Reply via email to