Re: PostgreSQL (XADataSource) as Tomcat Resource - Mailing list pgsql-jdbc

From Guy Rouillier
Subject Re: PostgreSQL (XADataSource) as Tomcat Resource
Date
Msg-id CC1CF380F4D70844B01D45982E671B230137A843@mtxexch01.add0.masergy.com
Whole thread Raw
In response to PostgreSQL (XADataSource) as Tomcat Resource  ("markds75" <markds75@gmail.com>)
Responses Re: PostgreSQL (XADataSource) as Tomcat Resource  ("markds75" <markds75@gmail.com>)
Re: PostgreSQL (XADataSource) as Tomcat Resource  ("markds75" <markds75@gmail.com>)
List pgsql-jdbc
markds75 wrote:
> How can I get Postgres to be deployed in Tomcat's JNDI as an
> XADataSource?
>
> I'm running my web app in Tomcat, and I'm moving towards distributed
> transactions for my two data sources (JDO and JCR). I've got the
> Jencks library providing JTA support (based on Geronimo's
> TransactionManager) within Tomcat. Currently, I have Postgres
> configured as a local web-app Resource as follows:
>
> <Resource name="jdbc/whisper_db"
>     auth="Container"
>     type="javax.sql.DataSource"
>     url="jdbc:postgresql://127.0.0.1:5432/my_db"
>     driverClassName="org.postgresql.Driver"
>     username="----------------"
>     password="----------------"
>     maxWait="3000"
>     maxIdle="100"
>     maxActive="10" />
>
> The web-app is able to start up without errors in this case and
> things function as expected. However, I've been told that I should be
> using an XADataSource if I want JDO to participate in distributed
> transactions (specifically, I'm trying to get 2 phase commit). When I
> change the type to "javax.sql.XADataSource", the web-app fails to
> start because Tomcat cannot create the JNDI entry. I'm running under
> Java 1.5, so to my knowledge XADataSource is included.

What does the Tomcat log tell you when it tried to start up this as an
XADatasource?  Did it provide any error message?  I've not set up an
XADatasource in Tomcat, but under JBoss you need to provide additional
statements to define an XADatasource.

>
> Any pointers would be appreciated.
>
> Thanks,
> Mark
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings



--
Guy Rouillier


pgsql-jdbc by date:

Previous
From: "Guy Rouillier"
Date:
Subject: Re: I just can't use the org.postgresql.Driver class... Please help!
Next
From: Kris Jurka
Date:
Subject: Re: do XA connections support SSL?