Caucho Forums

Caucho Forums (http://forum.caucho.com//index.php)
-   Resin (http://forum.caucho.com//forumdisplay.php?f=4)
-   -   Get a XADataSource (http://forum.caucho.com//showthread.php?t=28536)

yannick 11-24-2011 01:12 PM

Get a XADataSource
 
Hi,

I'd like to use XADataSource in my application.

I'm using resin 3.1.3, and put the following lines in my resin.xml :
Code:

    <database>
        <jndi-name>jdbc/test-xa</jndi-name>
        <xa>true</xa>
        <driver>
              <type>oracle.jdbc.xa.client.OracleXADataSource</type>
              <url>jdbc:oracle:thin:.....</url>
              <user>....</user>
              <password>....</password>
        </driver>
        <prepared-statement-cache-size>32</prepared-statement-cache-size>
        <max-connections>15</max-connections>
        <max-idle-time>30s</max-idle-time>
    </database>

When I'm trying to get a XADataSource, resin take me a DBPool (extends DataSource), which is useless for me...

How to get a XADataSource (for use with JTA outside ejbs) ?

alex 11-25-2011 05:09 PM

Can you elaborate why you need an instance of XADatasource please?

Normally, you shouldn't need one, because distributed transactions should be handled by the container via providing a UserTransaction object. The javax.transaction.UserTransaction object is looked up from JNDI.

UserTransaction object manages distributed transactions on behalf of the client's code.

Note: we will be releasing 3.1.13 with some important fixes for handling distributed transaction recover scenario for Oracle. I recommend that you upgrade to 3.1.12 at least, as it provides a few important fixes in recovering failed distributed transactions.


All times are GMT. The time now is 05:01 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.