You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Milinda Lakmal Pathirage (JIRA)" <ji...@apache.org> on 2009/11/28 14:31:20 UTC

[jira] Created: (OPENJPA-1403) OSGi Aware Persistence Provider Implementation

OSGi Aware Persistence Provider Implementation
----------------------------------------------

                 Key: OPENJPA-1403
                 URL: https://issues.apache.org/jira/browse/OPENJPA-1403
             Project: OpenJPA
          Issue Type: New Feature
            Reporter: Milinda Lakmal Pathirage


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.


Re: [jira] Commented: (OPENJPA-1403) OSGi Aware Persistence Provider Implementation

Posted by Milinda Pathirage <mi...@gmail.com>.
Hi Kevin,

Thank you for your valuable feedback about this. I'll fix these and try to
find out solution for eclipse licensing issue.

Thanks,
Milinda

On Wed, Dec 2, 2009 at 5:46 AM, Kevin Sutter (JIRA) <ji...@apache.org> wrote:

>
>    [
> https://issues.apache.org/jira/browse/OPENJPA-1403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784556#action_12784556]
>
> Kevin Sutter commented on OPENJPA-1403:
> ---------------------------------------
>
> Hi Milinda,
> I haven't fully absorbed your patch and its implications yet, but I do have
> some initial comments on the patch content and format...
>
> o  Classloading is a touchy area.  OpenJPA needs to work in a standalone
> Java SE environment, an application server Java EE environment, and now the
> OSGi bundled environment.  As we integrated with the various application
> servers, we had to ensure that the classloading mechanisms continued to work
> in these other environments.  I'm not sure how much verification you have
> done with your proposed patch in these other environments.  On first glance,
> I didn't see that this alternate classloading mechanism kicked in just for
> the OSGi environment, or whether you are proposing that this new mechanism
> replaces our current classloading mechanism.  Just makes me nervous when I
> see changes to classloading...
>
> o  None of the new files have the Apache license at the top of the file.
>
> o  I saw this author tag in one of the files that makes me very nervous...
>
> + * @author shsmith from EclipseLink
>
> You mentioned that you based this patch off of how EclipseLink did
> something.  We can't just take code from EclipseLink without providing
> proper credit.  To be honest, I'm not sure how the licensing would work in
> this case.  Was this code covered by the Eclipse Public License?  Need more
> investigation and justification before we could ever accept code like this.
>
> o  Using splat (*) in the import statements is not sufficient.  With the
> tools available today, you can easily clean this up with the explicit
> imports.
>
> o  Test cases?  Not only for the OSGi environment, but if you are affecting
> current classloading, then what assurances do we have that nothing was
> affected?
>
> Trying hard not to rain on your parade.  Allowing OpenJPA to play in the
> OSGi environment is important to the project and we appreciate the input.
>  We just have a large set of customers that we need to continue to support.
>
> Thanks,
> Kevin
>
> > OSGi Aware Persistence Provider Implementation
> > ----------------------------------------------
> >
> >                 Key: OPENJPA-1403
> >                 URL: https://issues.apache.org/jira/browse/OPENJPA-1403
> >             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.
>
>


-- 
Milinda Pathirage
Senior Software Engineer & Product Manager WSO2 BPS; http://wso2.org/bps
WSO2 Inc.; http://wso2.com
E-mail: milinda@wso2.com, milinda.pathirage@gmail.com
Web: http://mpathirage.com
Blog: http://blog.mpathirage.com

[jira] Updated: (OPENJPA-1403) OSGi Aware Persistence Provider Implementation

Posted by "Milinda Lakmal Pathirage (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-1403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Milinda Lakmal Pathirage updated OPENJPA-1403:
----------------------------------------------

    Attachment: osgi.patch

> OSGi Aware Persistence Provider Implementation
> ----------------------------------------------
>
>                 Key: OPENJPA-1403
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1403
>             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.


[jira] Commented: (OPENJPA-1403) OSGi Aware Persistence Provider Implementation

Posted by "Milinda Lakmal Pathirage (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12783352#action_12783352 ] 

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.

Thanks
Milinda

> OSGi Aware Persistence Provider Implementation
> ----------------------------------------------
>
>                 Key: OPENJPA-1403
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1403
>             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.


[jira] Commented: (OPENJPA-1403) OSGi Aware Persistence Provider Implementation

Posted by "Kevin Sutter (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784861#action_12784861 ] 

Kevin Sutter commented on OPENJPA-1403:
---------------------------------------

I just talked with my OSGi contacts and it's my understanding that RFC 143 is very close to publishing.  This RFC should outline the specific requirements for a JPA provider in a non-managed environment.  I think it would be best to wait until that RFC becomes public before incorporating an OSGi-enablement patch into OpenJPA.  Feel free to continue working the issues outlined in my initial review, but my position at this time would be to wait before integrating any code changes.

Thanks,
Kevin

> OSGi Aware Persistence Provider Implementation
> ----------------------------------------------
>
>                 Key: OPENJPA-1403
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1403
>             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.


[jira] Commented: (OPENJPA-1403) OSGi Aware Persistence Provider Implementation

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784954#action_12784954 ] 

Donald Woods commented on OPENJPA-1403:
---------------------------------------

I haven't looked thoroughly at the patch source (have the same EPL concerns as Kevin), but it does follow the design direction I started working on, by creating a openjpa-osgi module that contains the OSGi specific classloading and PersistenceProvider that would work for OSGi users, but leaves the existing code (openjpa.jar and openjpa-all.jar) unmodified.  This is done by extending the existing PersistnceProviderImpl with an OSGi aware version - openjpa-osgi/src/main/java/org/apache/openjpa/osgi/OSGiPersistenceProviderImpl.java

Given EPL 1.0 is considered a category B license -
    http://www.apache.org/legal/resolved.html#category-b
we should not include any EPL licensed Java source in OpenJPA.  A schema/DTD would be fine, but not Java code.
Please recreate the patch without using any EPL source or chime in on the dev list for the Aries Incubator project to help create a RFC 143 cleanroom implementation.


> OSGi Aware Persistence Provider Implementation
> ----------------------------------------------
>
>                 Key: OPENJPA-1403
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1403
>             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.


[jira] Closed: (OPENJPA-1403) OSGi Aware Persistence Provider Implementation

Posted by "Donald Woods (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OPENJPA-1403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Donald Woods closed OPENJPA-1403.
---------------------------------

    Resolution: Duplicate

1) This code includes EPL licensed material and cannot/will not be pulled into the OpenJPA svn repo.
2) The Apache Aries project is working on implementing OSGi RFC 143 JPA support and should be the venue used to implement this support at Apache.


> OSGi Aware Persistence Provider Implementation
> ----------------------------------------------
>
>                 Key: OPENJPA-1403
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1403
>             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.


[jira] Commented: (OPENJPA-1403) OSGi Aware Persistence Provider Implementation

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12783259#action_12783259 ] 

Craig Russell commented on OPENJPA-1403:
----------------------------------------

I'm not an OSGi expert, but it's not clear to me that OpenJPA should have "support to replace central class load[er]" to load classes that it doesn't statically know about. User-defined classes are by definition supposed to be loaded dynamically (as far as OpenJPA is concerned). 

So why is Dynamic-Imports not "OSGi best practice" for service providers such as OpenJPA? 

> OSGi Aware Persistence Provider Implementation
> ----------------------------------------------
>
>                 Key: OPENJPA-1403
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1403
>             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.


[jira] Commented: (OPENJPA-1403) OSGi Aware Persistence Provider Implementation

Posted by "Kevin Sutter (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OPENJPA-1403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12784556#action_12784556 ] 

Kevin Sutter commented on OPENJPA-1403:
---------------------------------------

Hi Milinda,
I haven't fully absorbed your patch and its implications yet, but I do have some initial comments on the patch content and format...  

o  Classloading is a touchy area.  OpenJPA needs to work in a standalone Java SE environment, an application server Java EE environment, and now the OSGi bundled environment.  As we integrated with the various application servers, we had to ensure that the classloading mechanisms continued to work in these other environments.  I'm not sure how much verification you have done with your proposed patch in these other environments.  On first glance, I didn't see that this alternate classloading mechanism kicked in just for the OSGi environment, or whether you are proposing that this new mechanism replaces our current classloading mechanism.  Just makes me nervous when I see changes to classloading...

o  None of the new files have the Apache license at the top of the file.

o  I saw this author tag in one of the files that makes me very nervous...

+ * @author shsmith from EclipseLink

You mentioned that you based this patch off of how EclipseLink did something.  We can't just take code from EclipseLink without providing proper credit.  To be honest, I'm not sure how the licensing would work in this case.  Was this code covered by the Eclipse Public License?  Need more investigation and justification before we could ever accept code like this.

o  Using splat (*) in the import statements is not sufficient.  With the tools available today, you can easily clean this up with the explicit imports.

o  Test cases?  Not only for the OSGi environment, but if you are affecting current classloading, then what assurances do we have that nothing was affected?

Trying hard not to rain on your parade.  Allowing OpenJPA to play in the OSGi environment is important to the project and we appreciate the input.  We just have a large set of customers that we need to continue to support.

Thanks,
Kevin

> OSGi Aware Persistence Provider Implementation
> ----------------------------------------------
>
>                 Key: OPENJPA-1403
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1403
>             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.