aries-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harald Wellmann <>
Subject OSGi JPA and JDBC Services
Date Thu, 16 Sep 2010 18:31:48 GMT
I'm currently trying to make OpenJPA 2.0.1 work in an OSGi environment, and while looking for
examples, I found a pointer to Apache Aries on the OpenJPA Users' mailing list.

So I had a look at the Aries website, checked out the latest code from trunk, played around
with it for a couple of hours and was left with no usable result - it sort of feels like being
offered a four course meal when all you were asking for was a plate of soup, and you don't
even get a spoon...

All I want to do is use OpenJPA in plain old unmanaged mode and have it discover my persistence
units and load classes from my application bundles without DynamicImport-Package, buddy policies
or fragments. I am currently perfectly happy with Declarative Services and have no intention
of converting my application to Blueprint.

Can Aries be used to achieve just that? If so, what is the minimum set of Aries bundles I
need to include in my application?

I got as far as having my persistence unit discovered, but on creating an EntityManagerFactory,
OpenJPA always complained about missing JTA support. Does Aries implement unmanaged JPA at
all? (It is supported by the OSGi JPA spec, at any rate.) I can only see a call of PersistenceProvider.createContainerEntityManagerFactory()
in Aries and no occurrence of createEntityManagerFactory(). On the OpenJPA side, there is
some code related to OSGi classloaders, but again, this is just used for the managed factories
and not for the unmanaged ones.

Another question: how does the Persistence Provider discover the data source - where does
the magic happen so that the lookup of <jta-data-source>osgi:service:/javax.sql.DataSource</jta-data-source>
will work? Is that done by Aries alone, or does the persistence provider need to be OSGi aware
in this respect?

Thanks in advance for any hints!

Best regards,

View raw message