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 "EclipseLinkCachingAndLocking"

(Optimistic Locking)
m
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
= Functional Specification: Dali Support for EclipseLink Caching and Optimistic Locking =
 
= Functional Specification: Dali Support for EclipseLink Caching and Optimistic Locking =
 +
 +
[[Talk:EclipseLinkCachingAndLocking | Feedback]]
  
 
[http://bugs.eclipse.org/239137 bug 239137] - cache support
 
[http://bugs.eclipse.org/239137 bug 239137] - cache support
Line 56: Line 58:
 
** None
 
** None
 
* @ExistenceChecking supported in Entity and MappedSuperclass classes.
 
* @ExistenceChecking supported in Entity and MappedSuperclass classes.
** Default (Check Cache)
+
** Default (Check Database) - if the empty annotation is added, the default becomes Check Cache.  See the second screen shot below
 
** Check Cache  -> ExistenceType.CHECK_CACHE
 
** Check Cache  -> ExistenceType.CHECK_CACHE
 
** Check Cache then Database  -> ExistenceType.CHECK_DATABASE
 
** Check Cache then Database  -> ExistenceType.CHECK_DATABASE
Line 62: Line 64:
 
** Assume Non-Existence  -> ExistenceType.ASSUME_NON_EXISTENCE
 
** Assume Non-Existence  -> ExistenceType.ASSUME_NON_EXISTENCE
 
* Shared Cache
 
* Shared Cache
** What should we label this instead?  Possibly options are 'Cache in L2 Cache' or 'Maintain in L2 Cache'.  In the @Cache annotation it is just 'shared'.
+
** What should we label this instead?  Possible options are 'Cache in L2 Cache' or 'Maintain in L2 Cache'.  In the @Cache annotation it is just 'shared'.
 
** If set to false then the panel is disabled and all Cache settings are removed.  You will be left with @Cache(shared=false) in the java source.
 
** If set to false then the panel is disabled and all Cache settings are removed.  You will be left with @Cache(shared=false) in the java source.
 
*Expiry
 
*Expiry
** Should we follow the Mapping Workbench or more closely follow the new EclispeLink annotations?  The 'Time To Live Expiry' would add the expiry element to the Cache annotation.  The 'Daily Expiry' would add the expiryTimeOfDay element to the Cache annotation. Potentially the radio buttons could be 'No Expiry', 'Expiry', 'Time of Day Expiry'
+
** Should we follow the Mapping Workbench or more closely follow the new EclipseLink annotations?  The 'Time To Live Expiry' would add the expiry element to the Cache annotation.  The 'Daily Expiry' would add the expiryTimeOfDay element to the Cache annotation. Potentially the radio buttons could be 'No Expiry', 'Expiry', 'Time of Day Expiry'
  
 
'''Entity 'Caching' section'''
 
'''Entity 'Caching' section'''
  
 
[[Image: EntityCaching.jpg]]
 
[[Image: EntityCaching.jpg]]
 +
 +
 +
Existence Checking combo if the ExistenceChecking annotation or xml element exists, the default changes.
 +
 +
[[Image: ExistenceChecking.jpg]]
  
  
Line 83: Line 90:
 
=== Optimistic Locking ===
 
=== Optimistic Locking ===
  
*[[Using_EclipseLink_JPA_Extensions_(ELUG)#Using_EclipseLink_JPA_Extensions_for_Optimistic_Locking|@OptimisticLocking]] supported in Entity and MappedSuperclass classes.
+
*[[Using_EclipseLink_JPA_Extensions_(ELUG)#Using_EclipseLink_JPA_Extensions_for_Optimistic_Locking|@OptimisticLocking]] annotation supported in Entity and MappedSuperclass classes. Corresponding eclipselink-orm.xml element is optimistic-locking
 
* Type Options
 
* Type Options
 
** Default (Version Column)
 
** Default (Version Column)
Line 95: Line 102:
 
** If using Optimistic Locking with anything other than Version Column, the @Version annotation will be ignored (warning, not error, for this)
 
** If using Optimistic Locking with anything other than Version Column, the @Version annotation will be ignored (warning, not error, for this)
 
** If 'cascade' is set and type is not 'Version Column', warning that it is not supported.
 
** If 'cascade' is set and type is not 'Version Column', warning that it is not supported.
** If type is 'Version Column' there must be a mapping marked @Version. (Is this correct or does it just have to be mapped and not a primary key as the EclipseLink docs state??)
+
** If type is 'Version Column' or @OptimisticLocking is specified without a type, there must be a mapping marked @Version.
 
+
 
+
 
+
  
'''Optimistic Locking section'''
+
* If no @Version annotation exists the Default option will display 'Default (None)
* None is chosen if no @Version annotation on an attribute and no @OptimisticLocking on the Entity
+
* If a Version annotation exists, the default option will display 'Default (Version Column)
* Default (Version Column) is chosen if @Version exists on an attribute and @OptimisticLocking does not exist on the Entity
+
  
  

Latest revision as of 14:51, 18 September 2008

Functional Specification: Dali Support for EclipseLink Caching and Optimistic Locking

Feedback

bug 239137 - cache support

bug 239148 - optimistic locking support

Document History

Date Author Version Description & Notes
7-1-2008 Karen Butzke Draft

Project overview

This feature covers entity/mapped superclass level caching and optimistic locking supported by the EclipseLink JPA extension.

Goals:

  • Add JPA Details view widgets for the Cache, ExistenceChecking, OptimisticLocking annotations
  • Add JPA Details view widgets for eclipselink-orm.xml cache, existence-checking and optimistic-locking elements
  • Provide the appropriate defaults and validation for these settings

Concepts

Present any concepts relevant to the feature.

EclipseLink Cache annotation documentation

EclipseLink OptimisticLocking annotation documentation

Requirements / Functionality

Caching

  • @Cache supported in Entity and MappedSuperclass classes.
  • Cache Type options
    • Default (Weak with Soft subcache)
    • Weak with Soft Subcache -> CacheType.SOFT_WEAK
    • Weak with Hard Subcache -> CacheType.HARD_WEAK
    • Weak -> CacheType.WEAK
    • Soft -> CacheType.SOFT
    • Full -> CacheType.FULL
    • Cache -> CacheType.CACHE - do we want to support this?? We didn't in the mapping workbench
    • None -> CacheType.NONE
  • Coordination Type
    • Default (Send Object Changes)
    • Send Object Changes
    • Invalidate Changed Objects
    • Send New Objects with Changes
    • None
  • @ExistenceChecking supported in Entity and MappedSuperclass classes.
    • Default (Check Database) - if the empty annotation is added, the default becomes Check Cache. See the second screen shot below
    • Check Cache -> ExistenceType.CHECK_CACHE
    • Check Cache then Database -> ExistenceType.CHECK_DATABASE
    • Assume Existence -> ExistenceType.ASSUME_EXISTENCE
    • Assume Non-Existence -> ExistenceType.ASSUME_NON_EXISTENCE
  • Shared Cache
    • What should we label this instead? Possible options are 'Cache in L2 Cache' or 'Maintain in L2 Cache'. In the @Cache annotation it is just 'shared'.
    • If set to false then the panel is disabled and all Cache settings are removed. You will be left with @Cache(shared=false) in the java source.
  • Expiry
    • Should we follow the Mapping Workbench or more closely follow the new EclipseLink annotations? The 'Time To Live Expiry' would add the expiry element to the Cache annotation. The 'Daily Expiry' would add the expiryTimeOfDay element to the Cache annotation. Potentially the radio buttons could be 'No Expiry', 'Expiry', 'Time of Day Expiry'

Entity 'Caching' section

EntityCaching.jpg


Existence Checking combo if the ExistenceChecking annotation or xml element exists, the default changes.

ExistenceChecking.jpg


For reference, 'Caching' tab from the MW

MWCaching.jpg


For reference, 'Refreshing Cache Options' section from the MW

MWCaching2.jpg

Optimistic Locking

  • @OptimisticLocking annotation supported in Entity and MappedSuperclass classes. Corresponding eclipselink-orm.xml element is optimistic-locking
  • Type Options
    • Default (Version Column)
    • All Columns -> OptimisticLockingType.ALL_COLUMNS
    • Changed Columns -> OptimisticLockingType.CHANGED_COLUMNS
    • Selected Columns -> OptimisticLockingType.SELECTED_COLUMNS
    • Version Column -> OptimisticLockingType.VERSION_COLUMN
  • Validation
    • Type is 'Selected Columns' but no columns are selected
    • Selected Columns must be mapped and must not be primary keys
    • If using Optimistic Locking with anything other than Version Column, the @Version annotation will be ignored (warning, not error, for this)
    • If 'cascade' is set and type is not 'Version Column', warning that it is not supported.
    • If type is 'Version Column' or @OptimisticLocking is specified without a type, there must be a mapping marked @Version.
  • If no @Version annotation exists the Default option will display 'Default (None)
  • If a Version annotation exists, the default option will display 'Default (Version Column)


EntityOptimisticLocking2.jpg


For Reference, Locking tab from MW

MWLocking.jpg

API

Issues

This section lists the open issues that are still pending that must be decided prior to fully implementing this project's requirements.

Issue # Owner Description / Notes Decision

Future Considerations

During the research for this project the following items were identified as out of scope but are captured here as potential future enhancements. If agreed upon during the review process these should be logged in the bug system.

Back to the top