Hi,

we are trying to access a database from a session bean like this:

ds = ( DataSource )context.lookup( "java:comp/env/jdbc/xa/TestXADS);

ejb-jar.xml:

...

<resource-ref>
      <res-ref-name>jdbc/xa/TestXADS</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
</resource-ref>

...


datasources.xml:

<data-sources>

...

  <data-source class="com.evermind.sql.DefaultXADataSource" 
location="jdbc/xa/TestXADS" inactivity-timeout="30">
     <name>Test Transactional data-source</name>
         <description>
               This is a data-source that can be used as an ordinary 
XAdata-source
                (transaction aware).
          </description>
          <source-location>jdbc/TestDS</source-location>
          <username>test</username>
          <password>test</password>
</data-source>

...

   <data-source class="com.evermind.sql.DefaultXADataSource" 
location="jdbc/xa/Test1XADS" inactivity-timeout="30">
     <name>Test1 Transactional data-source</name>
         <description>
               This is a data-source that can be used as an ordinary 
XAdata-source
                (transaction aware).
          </description>
          <source-location>jdbc/Test1DS</source-location>
          <username>test1</username>
          <password>test1</password>

</data-source>

</data-sources>

Now when using a connection from ds.getConnection() we are always connected 
to the db as user test1
instead of user test. If we place the "jdbc/xa/TestXADS" datasource at the 
bottom of datasources.xml we get
the right connection.

It seems orion always connects using the last entry in datasources.xml, not 
matching the location attribute correctly.


jochen strunk



(-) Jochen Strunk
(-) SIGNAL 7 Gesellschaft f�r Informationstechnologie mbH
(-) Br�der-Knau�-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665402, Fax: 06151 665373
(-) [EMAIL PROTECTED], www.signal7.de

Reply via email to