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

Bug 312010

Summary: WDF tests assume that persistent id is available right after persist
Product: z_Archived Reporter: Adrian Goerler <adrian.goerler>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: trivial    
Priority: P3 CC: eclipselink.orm-inbox, sabine.heider
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
URL: http://wiki.eclipse.org/Talk:EclipseLink/Bugs/309681#Persistent_identity_not_assigned_by_persist.3F
Whiteboard: test simple_fix
Bug Depends on:    
Bug Blocks: 309681    
Attachments:
Description Flags
proposed patch none

Description Adrian Goerler CLA 2010-05-07 03:22:05 EDT
The WDF tests assume that the persistent id is available right after the persist operation. The reasoning for this is deduced from the specification as follows:

§3.2.2 Persisting an entity instance: 
A new entity instance becomes both managed and persistent by invoking the persist method on it. 

§3.2 Entity Instance’s Life Cycle
A managed entity instance is an instance with a persistent identity that is currently associated with a persistence context.

In EclipseLink however, the interpretation seems to be that the persist operation ensures that an entity will *eventually* get a persistent identity upon the flush operation.
an entity the "persistent identity"
Comment 1 Adrian Goerler CLA 2010-05-07 09:09:24 EDT
Created attachment 167466 [details]
proposed patch 

Proposed patch for TestIdentity -> do a flush after persist

Tested on MySQL -> OK
Comment 2 Adrian Goerler CLA 2010-05-07 10:27:25 EDT
checked in at # 7178
tested on MySQL
reviewed by Andreas
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:17:13 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:25:39 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink