openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Milinda Lakmal Pathirage (JIRA)" <>
Subject [jira] Commented: (OPENJPA-1403) OSGi Aware Persistence Provider Implementation
Date Sun, 29 Nov 2009 02:38:20 GMT


Milinda Lakmal Pathirage commented on OPENJPA-1403:

Hi Craig,

I'm also not an expert in OSGi. But according to my experience, sometime dynamic imports caused
problems in class loading because we cannot guarantee to which bundle OpenJPA will bind at
runtime. There are lot of discussion going around dynamic imports in the web. But I think
 if we can use same composite class loader I used to load persistence.xml files we can avoid
such problems in future. Current implementation with dynamic imports work fine. But sometimes
we cannot know exactly what type of environment there in the OSGi container, for example there
may be several versions of the same bundle and we cannot control bundle wiring when we use
dynamic imports in this case.

I think we can go ahead with dynamic imports in the initial version of OSGI support and we
can consider about improvements using the feedback from the community.


> OSGi Aware Persistence Provider Implementation
> ----------------------------------------------
>                 Key: OPENJPA-1403
>                 URL:
>             Project: OpenJPA
>          Issue Type: New Feature
>            Reporter: Milinda Lakmal Pathirage
>         Attachments: osgi.patch
> Current OpenJPA trunk implementation doesn't have full support for using OpenJPA in OSGi
containers. For example when OSGi bundle which use OpenJPA deployed, OpenJPA persistence provider
cannot locate the persistence.xml in that bundle due to class loading differences in OSGi
environment. EclipseLink has resolved this by using bundle listeners and JPA specific OSGi
bundle header. Patch provided in this JIRA solve issues in OpenJPA in OSGi environment by
following method used in EclipseLink. But there is a problem with current OpenJPA implementation
which caused me to add Dynamic-Imports header to OpenJPA OSGi bundle to allow loading classes
from bundles that use OpenJPA. I think current OpenJPA implementation doesn't provide support
to replace central class load to support loading classes from bundles which use OpenJPA. If
we have that support we'll be able to remove Dynamic-Imports and make OpenJPA OSGi bundle
follow OSGi best practices .
> Please review the path and provide your ideas about this patch. 

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message