[jboss-user] [EJB 3.0] - Re: Exception in Distributed transaction in EJB3.0

ajayks do-not-reply at jboss.com
Mon Oct 20 03:55:31 EDT 2008


Thanks a lot for the reply.
I  have used EJB3.O entity bean in my session bean to update the databses's table.
The XML configuration files of databases are put in the deploy directory of JBOSS which details are  as follwos:-

Databas X:
---------

  | <?xml version="1.0" encoding="UTF-8"?>
  | 
  | <!-- ===================================================================== -->
  | <!--                                                                       -->
  | <!--  JBoss Server Configuration                                           -->
  | <!--                                                                       -->
  | <!-- ===================================================================== -->
  | 
  | <!-- $Id: oracle-ds.xml 63175 2007-05-21 16:26:06Z rrajesh $ -->
  | <!-- ==================================================================== -->
  | <!--  Datasource config for Oracle originally from Steven Coy             -->
  | <!-- ==================================================================== -->
  | 
  | 
  | <datasources>
  |   <local-tx-datasource>
  |     <jndi-name>ASDS</jndi-name>
  |     <connection-url>jdbc:oracle:thin:@pkgqcenv.dlh.st.com:1541:xcdb</connection-url>
  |         <!--
  | 
  |                 Here are a couple of the possible OCI configurations.
  |                 For more information, see http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/java.920/a96654/toc.htm
  | 
  |         <connection-url>jdbc:oracle:oci:@youroracle-tns-name</connection-url>
  |                 or
  |         <connection-url>jdbc:oracle:oci:@(description=(address=(host=youroraclehost)(protocol=tcp)(port=1521))(connect_data=(SERVICE_NAME=yourservicename)))</connection-url>
  | 
  |                 Clearly, its better to have TNS set up properly.
  |          -->
  |     <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
  |     <user-name>sicomdba</user-name>
  |     <password>useme123</password>
  |     <!-- 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-class-name-->
  |     <!-- 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>
  |         <!-- sql to call when connection is created
  |         <new-connection-sql>some arbitrary sql</new-connection-sql>
  |         -->
  | 
  |         <!-- sql to call on an existing pooled connection when it is obtained from pool - the OracleValidConnectionChecker is prefered
  |         <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
  |         -->
  | 
  |       <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml -->
  |       <metadata>
  |          <type-mapping>Oracle9i</type-mapping>
  |       </metadata>
  |   </local-tx-datasource>
  | </datasources>
  | 

Database Y
-----------

  | <?xml version="1.0" encoding="UTF-8"?>
  | 
  | <!-- ===================================================================== -->
  | <!--                                                                       -->
  | <!--  JBoss Server Configuration                                           -->
  | <!--                                                                       -->
  | <!-- ===================================================================== -->
  | 
  | <!-- $Id: oracle-ds.xml 63175 2007-05-21 16:26:06Z rrajesh $ -->
  | <!-- ==================================================================== -->
  | <!--  Datasource config for Oracle originally from Steven Coy             -->
  | <!-- ==================================================================== -->
  | 
  | <datasources>
  |   <local-tx-datasource>
  |     <jndi-name>euxDS</jndi-name>
  |     <connection-url>jdbc:oracle:thin:@eux074.sgp.st.com:2591:s2xy</connection-url>
  |         <!--
  | 
  |                 Here are a couple of the possible OCI configurations.
  |                 For more information, see http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/java.920/a96654/toc.htm
  | 
  |         <connection-url>jdbc:oracle:oci:@youroracle-tns-name</connection-url>
  |                 or
  |         <connection-url>jdbc:oracle:oci:@(description=(address=(host=youroraclehost)(protocol=tcp)(port=1521))(connect_data=(SERVICE_NAME=yourservicename)))</connection-url>
  | 
  |                 Clearly, its better to have TNS set up properly.
  |          -->
  |     <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
  |     <user-name>xcomdba</user-name>
  |     <password>paxy99</password>
  |     <!-- 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-class-name-->
  |     <!-- 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>
  |         <!-- sql to call when connection is created
  |         <new-connection-sql>some arbitrary sql</new-connection-sql>
  |         -->
  | 
  |         <!-- sql to call on an existing pooled connection when it is obtained from pool - the OracleValidConnectionChecker is prefered
  |         <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
  |         -->
  | 
  |       <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml -->
  |       <metadata>
  |          <type-mapping>Oracle9i</type-mapping>
  |       </metadata>
  |   </local-tx-datasource>
  | </datasources
  | 
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4183132#4183132

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4183132



More information about the jboss-user mailing list