Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 361552 - Eclipselink does ignore the property javax.persistence.provider
Summary: Eclipselink does ignore the property javax.persistence.provider
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-20 10:26 EDT by Arne Limburg CLA
Modified: 2022-06-09 10:35 EDT (History)
3 users (show)

See Also:


Attachments
Patch (4.28 KB, patch)
2012-09-10 11:08 EDT, Gordon Yorke CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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