Matthew Pitts created ARIES-1376:
------------------------------------
Summary: RecoverableDataSource passes empty, non-null
username/password
Key: ARIES-1376
URL: https://issues.apache.org/jira/browse/ARIES-1376
Project: Aries
Issue Type: Bug
Components: Transaction
Affects Versions: transaction-jdbc-2.1.1
Reporter: Matthew Pitts
When trying to combine the below components into an OSGi application to create
a JPA+JTA+JNDI-DataSource persistence unit, I get runtime connection errors to
MySQL saying "Access denied for user ''@'localhost' (using password: NO)".
* eclipselink
* aries-jpa
* aries-transaction
* pax-jdbc
* pax-jdbc-pool-aries
Tracing through the code, it seems as though empty-string username and password
values are being passed through to the factory types, which are in-turn calling
the two-arg form of getConnection, rather than the no-arg form. I would expect
it to be calling the no-arg form for delegated/pooled DataSource connections.
The empty-string username and password values seem to originate from the fields
on RecoverableDataSource, as it defaults them to empty strings rather than
nulls. If I remove these default field values, my app seems to run as expected
with no connection errors and I am able to read from the database.
I'm not sure if the empty-string values need to stay here and there should be
some additional downstream check somewhere else for non-null and non-empty
before deciding which getConnection to invoke. Or, if it would be OK to just
have these fields default to null.
If someone can confirm this is a bug I may be able to put together a patch. I'm
currently building my workaround using the source available from maven for the
org.apache.aries.transaction.jdbc-2.1.1 bundle.
Thanks
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)