Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "EclipseLink/Development/JPA 2.0/standard properties"

m (Work Required)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= Standardized Properties =
+
__NOTOC__
[[EclipseLink/Development/JPA_2.0 | JPA 2.0 Root]] |   
+
= JPA 2.0: Standardized Properties =
[http://bugs.eclipse.org/249023 Enhancement Request]
+
 
==Issue Summary==
+
[[EclipseLink/Development/JPA_2.0 | JPA 2.0 Root]] |  {{bug|249023}}
 +
 
 +
{|{{BMTableStyle}}
 +
|-{{BMTHStyle}}
 +
! Date
 +
! Committer(s)
 +
! Description
 +
|-
 +
| Feb 2, 2009 || [[User:Douglas.clarke.oracle.com | dclarke]] || Initial feature template
 +
|-
 +
|}
 +
 
 +
== Summary==
 +
 
 
In JPA 2.0 the specification has defined standard persistence unit properties for JDBC setting.  These properties will need to be supported
 
In JPA 2.0 the specification has defined standard persistence unit properties for JDBC setting.  These properties will need to be supported
  
See JPA 2.0 ED section [https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_JCP-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=persistence-2.0-pr-oth-JSpec@CDS-CDS_JCP 7.2.1.7] (previously 6.2.1.7) for details.
+
See JPA 2.0 PR section [https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_JCP-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=persistence-2.0-pr-oth-JSpec@CDS-CDS_JCP 8.2.1.9] (previously ED 7.2.1.7) for details.
  
==General Solution==
+
* Java EE and SE Properties
 +
** javax.persistence.query.timeout — value in seconds for query timeout
 +
* Java SE Properties
 +
** javax.persistence.jdbc.driver — fully qualified name of the driver class
 +
** javax.persistence.jdbc.url — driver-specific URL
 +
** javax.persistence.jdbc.user — username used by database connection
 +
** javax.persistence.jdbc.password — password for database connection validation
 +
** javax.persistence.lock.timeout — value in milliseconds for pessimistic lock timeout
 +
** javax.persistence.validation.group.pre-persist— groups that are targeted for validation upon the pre-persist event (overrides the default behavior).
 +
** javax.persistence.validation.group.pre-update— groups that are targeted for validation upon the pre-update event (overrides the default behavior).
 +
** javax.persistence.validation.group.pre-remove— groups that are targeted for validation upon the pre-remove event (overrides the default behavior).
  
Should be a simple translation to our existing properties.  We will want to deprecate our existing properties.
+
The last three validation properties are yet to be implemented.
 +
 
 +
=== Work Estimate ===
  
==Work Required==
 
 
# Develop model for testing access type settings
 
# Develop model for testing access type settings
 
#: approx 2 days
 
#: approx 2 days
 
# Update processing
 
# Update processing
 
#: approx 2 days
 
#: approx 2 days
 +
 +
== Functional Requirements ==
 +
 +
* Support using new standard property names
 +
* Support using existing eclipselink.jdbc properties as completely interchangeable with standard ones
 +
* Add these properties to EntityManagerFactory.getSupportedProperties() and EntityManager.getSupportedProperties()
 +
 +
== Design ==
 +
 +
'javax.persistence.query.Timeout' once set in persistence.xml, its value is retrieved in EntityManagerSetUpImpl class and
 +
is stored in AbstractSession class using get() and set() methods of query Timeout. When preparing the query in DatabaseQuery
 +
class, the stored value from the AbstractSession is retrieved and is set to the query. If the user sets the query timeout using
 +
'setHint()' , then the value set by the user overrides the persistence.xml value.
 +
 +
'javax.persistence.lock.timeout' is also implemented in the similar way to the query timeout.
 +
 +
 +
== Documentation ==
 +
 +
== Testing ==
 +
 +
queryTimeout is tested as follows:
 +
 +
Value of 'queryTimeout' is set in persistence.xml and compared with the value of query timeout in ObjectLevelReadQuery class.(both should be equal)
 +
And then set the queryTimeout using 'setHint()' and compare its value to the query Timeout in ObjectLevelReadQuery class.
 +
It overrides the existing value with the value set by the user.
 +
 +
 +
== Open Issues ==
 +
 +
# Deprecation of existing properties
 +
#* Backwards compatibility?
 +
#* Forward Migration?
 +
#* When should we finally remove the eclipselink.* properties?

Latest revision as of 18:37, 17 March 2009

JPA 2.0: Standardized Properties

JPA 2.0 Root | bug 249023

Date Committer(s) Description
Feb 2, 2009 dclarke Initial feature template

Summary

In JPA 2.0 the specification has defined standard persistence unit properties for JDBC setting. These properties will need to be supported

See JPA 2.0 PR section 8.2.1.9 (previously ED 7.2.1.7) for details.

  • Java EE and SE Properties
    • javax.persistence.query.timeout — value in seconds for query timeout
  • Java SE Properties
    • javax.persistence.jdbc.driver — fully qualified name of the driver class
    • javax.persistence.jdbc.url — driver-specific URL
    • javax.persistence.jdbc.user — username used by database connection
    • javax.persistence.jdbc.password — password for database connection validation
    • javax.persistence.lock.timeout — value in milliseconds for pessimistic lock timeout
    • javax.persistence.validation.group.pre-persist— groups that are targeted for validation upon the pre-persist event (overrides the default behavior).
    • javax.persistence.validation.group.pre-update— groups that are targeted for validation upon the pre-update event (overrides the default behavior).
    • javax.persistence.validation.group.pre-remove— groups that are targeted for validation upon the pre-remove event (overrides the default behavior).

The last three validation properties are yet to be implemented.

Work Estimate

  1. Develop model for testing access type settings
    approx 2 days
  2. Update processing
    approx 2 days

Functional Requirements

  • Support using new standard property names
  • Support using existing eclipselink.jdbc properties as completely interchangeable with standard ones
  • Add these properties to EntityManagerFactory.getSupportedProperties() and EntityManager.getSupportedProperties()

Design

'javax.persistence.query.Timeout' once set in persistence.xml, its value is retrieved in EntityManagerSetUpImpl class and is stored in AbstractSession class using get() and set() methods of query Timeout. When preparing the query in DatabaseQuery class, the stored value from the AbstractSession is retrieved and is set to the query. If the user sets the query timeout using 'setHint()' , then the value set by the user overrides the persistence.xml value.

'javax.persistence.lock.timeout' is also implemented in the similar way to the query timeout.


Documentation

Testing

queryTimeout is tested as follows:

Value of 'queryTimeout' is set in persistence.xml and compared with the value of query timeout in ObjectLevelReadQuery class.(both should be equal) And then set the queryTimeout using 'setHint()' and compare its value to the query Timeout in ObjectLevelReadQuery class. It overrides the existing value with the value set by the user.


Open Issues

  1. Deprecation of existing properties
    • Backwards compatibility?
    • Forward Migration?
    • When should we finally remove the eclipselink.* properties?

Back to the top