Bug 313367 - JPA: Persistence Unit property eclipselink.jdbc (deprecated) overrides standard javax.persistence properties
Summary: JPA: Persistence Unit property eclipselink.jdbc (deprecated) overrides standa...
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-18 10:41 EDT by Michael OBrien CLA
Modified: 2022-06-09 10:03 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael OBrien CLA 2010-05-18 10:41:38 EDT
>When users use both the standard javax.persistence and the deprecated eclipselink.jdbc properties
- the deprecated properties take precedence over the standard ones (which are ignored
- this occurs for all of [username, password, driver, url]

>Use Both = javax.persistence ignored (driver is Oracle instead of Derby
properties.put("eclipselink.jdbc.driver", "org.apache.derby.jdbc.ClientDriver");  properties.put("javax.persistence.jdbc.driver", "oracle.jdbc.driver.OracleDriver");

>Fix: either we switch the default to use javax.persistence properties when both exists
>or we warn that both properties exist


>WARNING: The reason this bug is non-trivial is the fact that when the
>deprecated properties are removed and applications start using the javax.persistence properties
>- applications will start failing if the two properties are different


>we log both properties but give the impression that the derby one is used
>we print out the eclipselink.jdbc property as the javax.persistence property
[EL Info]: 2010-05-18 10:35:23.399--ServerSession(110167697)--Thread(Thread[main,5,main])--property eclipselink.jdbc.driver is deprecated, property javax.persistence.jdbc.driver should be used instead.
[EL Finest]: 2010-05-18 10:35:24.059--ServerSession(110167697)--Thread(Thread[main,5,main])--property=javax.persistence.jdbc.driver; value=org.apache.derby.jdbc.ClientDriver

>If we switch to 
properties.put("eclipselink.jdbc.driver","oracle.jdbc.driver.OracleDriver");
properties.put("javax.persistence.jdbc.driver","org.apache.derby.jdbc.ClientDriver");

>we get an unexpected use of the Oracle driver instead of the Derby driver
[EL Finest]: 2010-05-18 10:37:41.26--ServerSession(1925018301)--Thread(Thread[main,5,main])--property=javax.persistence.jdbc.driver; value=oracle.jdbc.driver.OracleDriver

Exception Description: Configuration error.  Class [oracle.jdbc.driver.OracleDriver] not found.
	at org.eclipse.persistence.exceptions.DatabaseException.configurationErrorClassNotFound(DatabaseException.java:82)
Comment 1 Tom Ware CLA 2010-06-07 14:24:50 EDT
Setting target and priority.  See the following page for details of the meanings of these fields:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:03:42 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink