Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 361552

Summary: Eclipselink does ignore the property javax.persistence.provider
Product: z_Archived Reporter: Arne Limburg <arne.limburg>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: eclipselink.orm-inbox, gordon.yorke, tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Patch none

Description Arne Limburg CLA 2011-10-20 10:26:57 EDT
Build Identifier: 2.2.0

When two persistence providers are in the classpath and you specify no persistence provider in the persistence.xml, but specifiy the other persistence provider (not eclipselink) via the javax.persistence.provider property in the map passed to Persistence.createEntityManagerFactory(...) then eclipselink will feel responsible for that persistence unit, but according to Chapter 9.2 of the JPA 2 spec this should not be the case.

Reproducible: Always

Steps to Reproduce:
1. Have eclipselink in the classpath
2. Create a persistence unit with no persistence provider specified
3. Call Persistence.createEntityManagerFactory with a map containing a key "javax.persistence.provider" with a value other than org.eclipse.persistence.jpa.PersistenceProvider
Eclipselink will create an EntityManagerFactory for that persistence unit.
Comment 1 Arne Limburg CLA 2011-10-20 10:37:38 EDT
From looking at the source I think this should be fixed in JPAInitializer.isPersistenceProviderSupported(...) which should get the map as second parameter and test for the "javax.persistence.provider" property.
Comment 2 Tom Ware CLA 2011-11-09 13:53:24 EST
Setting target and priority.  See the following page for the meanings of these fields:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines

Community: Please vote for this bug if it is important to you.  Votes are one of the main criteria we use to determine which bugs to fix next.
Comment 3 Tom Ware CLA 2012-05-29 10:12:05 EDT
Deferring to next patch release.
Comment 4 Gordon Yorke CLA 2012-09-10 11:08:58 EDT
Created attachment 220897 [details]
Patch
Comment 5 Gordon Yorke CLA 2012-09-10 12:52:21 EDT
Patch checked in.
Reviewed by Tom Ware
Comment 6 Eclipse Webmaster CLA 2022-06-09 10:15:01 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 7 Eclipse Webmaster CLA 2022-06-09 10:35:22 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink