Kurt Westerfeld created ARIES-1078:
--------------------------------------

             Summary: JPA container stops locating providers for managers (PUs) 
when one provider is found
                 Key: ARIES-1078
                 URL: https://issues.apache.org/jira/browse/ARIES-1078
             Project: Aries
          Issue Type: Bug
          Components: JPA
    Affects Versions: 1.0
            Reporter: Kurt Westerfeld


In PersistenceBundleManager, there is a bit of code that deals with mating up 
managers who are waiting for providers (managersAwaitingProviders).  This code 
has an error when one provider is found, in that it checks for null after 
calling getProviderServiceReference on the wrong return value.

What happens is, you may have two providers in the OSGi registry.  When one is 
found, all managers who are waiting on a provider get removed from this list, 
even though not all may match.

I found this issue because I created a custom provider which allows for 
injecting configuration into the process of creating the entity manager, apart 
from that which is in persistence.xml.  I wanted to mate up configuration admin 
configuration, and so I subclassed the provider given by openjpa, and activated 
my bundle.  

The end result is, my persistence unit is registered with a null provider.

This is a quick one-liner fix; I will create a pull request.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to