Re: PGXADataSource does not implement DataSource - Mailing list pgsql-jdbc

From Heikki Linnakangas
Subject Re: PGXADataSource does not implement DataSource
Date
Msg-id 46292DCB.1010202@enterprisedb.com
Whole thread Raw
In response to Re: PGXADataSource does not implement DataSource  ("Bill Middleton" <utvikler@gmail.com>)
List pgsql-jdbc
Bill Middleton wrote:
> Hello again, and thanks for the feedback.  Yes, I'm likely in way over my
> head here.  However, things are working acceptably with minimal testing so
> far.  I register my modified PGXA as the resource in a
> UserTransactionService and then pass it into hibernate via jndi lookup,
> along with a transactionmanager.  The interesting bits of
> hibernate.cfg.xmlare then:
>
>    <property name="hibernate.dialect">
> org.hibernate.dialect.PostgreSQLDialect</property>
>    <property name="hibernate.connection.datasource
> ">java:comp:myDS</property>
>    <property name="hibernate.transaction.factory_class">
> org.hibernate.transaction.JTATransactionFactory</property>
>
> Hibernate accesses the DS in
> org.hibernate.connection.DataSourceConnectionProvider
>
> I'm using the atomikos TM, and sharing the DS between hibernate and a
> (also
> slightly modified) up jboss cache.

I'm not an expert on hibernate or atomikos, but I don't think hibernate
should ever see the raw PGXADataSource object. Whatever is handling the
connection pool, either Atomikos or JBoss, should get a connection from
the XADataSource object, and wrap that in a DataSource implementation of
it's own. That wrapper object is registered in JNDI, and hibernate gets
it from there.

Where is the connection pool configured? What's in the jboss cache and
how is it modified?

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

pgsql-jdbc by date:

Previous
From: "Bill Middleton"
Date:
Subject: Re: PGXADataSource does not implement DataSource
Next
From: "Bill Middleton"
Date:
Subject: Fwd: PGXADataSource does not implement DataSource