dev@glassfish.java.net

Re: Problems with container persistence.xml processing and non-jta connection pooling.

From: Jagadish Prasath Ramu <Jagadish.Ramu_at_Sun.COM>
Date: Thu, 01 Feb 2007 11:44:44 +0530

On Wed, 2007-01-31 at 22:35 +0530, Sanjeeb Kumar Sahoo wrote:
> Andrei Ilitchev wrote:
> > While fixing issue 2106 I ran upon the following problems in container:
> > 1. Even though no non-jta data source was specified in persistence.xml
> > a non-jta data source was created and passed to TopLink to be used for
> > reading.
> > That doesn't seem to be spec. complient.
> Reading the following javadocs comment as specified in section #7.1.4 of
> JPA spec, I think it is perfectly fine for a container to supply a
> non-jta-data-source object even if user did not specify a value in p.xml.
> /**
> * @return The non-JTA-enabled data source to be used by the
> * persistence provider for accessing data outside a JTA
> * transaction.
> * The data source corresponds to the named <non-jta-data-source>
> * element in the persistence.xml file or provided at
> * deployment or by the container.
> */
> public DataSource getNonJtaDataSource();
>
> > 2. Non-jta connection pool produces connections with autoCommit set to
> > false.
> > 3. After connection obtained from non-jta data source is closed it
> > still holds the locks.
> Jagadish, can you comment on #2 & #3? FYI, we use
> /ConnectorRuntime.getRuntime().lookupNonTxResource(DSName)/ to get hold
> of this data source.
>>From the tests I have, it works fine. JDBC-RA does not change the
autocommit value of connections in non-tx mode.

What type of datasource ? javax.sql.XADS / ConnectionPoolDS / DS ?

Can you check the default autocommit value of the connection in
stand-alone (non-EE) mode ?

If the datasource is not a XADataSource, can you please enable logging
to FINE for "connector" module and see whether
"ConnectorXAResource.end() called" is logged for a non-tx connection.

Thanks,
-Jagadish

>
> Thanks,
> Sahoo
> >
> > For more details please see
> > https://glassfish.dev.java.net/issues/show_bug.cgi?id=2106
> >
> > Thanks,
> >
> > Andrei
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> > For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
> >
>