Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Using EclipseLink in OSGi with Gemini JPA. Two questions. (Two questions about pooling and connection sharing)
Using EclipseLink in OSGi with Gemini JPA. Two questions. [message #871493] Mon, 14 May 2012 04:39 Go to previous message
GianMaria Romanato is currently offline GianMaria Romanato
Messages: 41
Registered: July 2009
Member
Hi,

I am developing an OSGi application that will be deployed in Virgo Tomcat Server.

Persistence is implemented using EclipseLink and the database connections are instantiated via Gemini JPA and a custom DBAccess for PostgreSQL.

I noticed that even if org.osgi.service.jdbc.DataSourceFactory offers methods to create a DataSource and a ConnectionPoolDataSource, EclipseLink/Gemini is always calling createDriver(Properties) and is wrapping the driver instance within a DataSource of its own to create connections.

First question
Is it right to assume that in such a configuration the pooling will be provided by EclipseLink itself? If true, can someone confirm that pooling must be configured via EclipseLink properties such as
eclipselink.jdbc.read-connections.*
and
eclipselink.jdbc.write-connections.*
?

Second question
I understand that the OSGi bluprint specification dictates that each persistence unit should be packaged in its own bundle. I see the advantages of this approach (i.e. maximum modularity, each unity may use different connection parameters etc), but at the same time, this may be not optimal if all the persistence units in a large application must be connected to the same database, because in such case, assuming that pooling is enabled, you would have several different pools of connections to the same database.

Is there a way to overcome this limitation other than packaging all of the units in the same OSGi bundle and merging their persistence.xml files?

For example, I read that EclipseLink supports composite units. Are they usable also in an OSGi environment together with Gemini JPA? Alternatively, is there a way to tell EclipseLink to merge all pools with equal connections parameters?

Thanks a lot.
Giamma.


 
Read Message
Read Message
Previous Topic:eclipselink programmatically generate persistentunit
Next Topic:JPQL Query List Parameter Exception
Goto Forum:
  


Current Time: Sun May 26 04:06:09 EDT 2013

Powered by FUDForum. Page generated in 0.01934 seconds