Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 331573 - Changes in @PostPersist don't cause update when calling merge after persist
Summary: Changes in @PostPersist don't cause update when calling merge after persist
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-01 12:29 EST by Robin Stocker CLA
Modified: 2022-06-09 10:19 EDT (History)
1 user (show)

See Also:


Attachments
Test case (1.09 KB, text/x-java)
2010-12-01 12:30 EST, Robin Stocker CLA
no flags Details
Test entity (679 bytes, text/x-java)
2010-12-01 12:31 EST, Robin Stocker CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Stocker CLA 2010-12-01 12:29:39 EST
Build Identifier: EclipseLink, version: Eclipse Persistence Services - 2.0.1.v20100213-r6600

When setting a field on an entity in a @PostPersist callback (or entity listener), the update is not detected and not written out during a subsequent flush() and merge().

Reproducible: Always

Steps to Reproduce:
See attached test case.
Comment 1 Robin Stocker CLA 2010-12-01 12:30:59 EST
Created attachment 184279 [details]
Test case
Comment 2 Robin Stocker CLA 2010-12-01 12:31:14 EST
Created attachment 184280 [details]
Test entity
Comment 3 Robin Stocker CLA 2010-12-01 12:32:14 EST
Only an insert is issued, like this:

INSERT INTO CALLBACKENTITY (ID, POSTPERSISTSTATE) VALUES (?, ?)
	bind => [1, null]
Comment 4 Tom Ware CLA 2010-12-03 09:04:16 EST
If you haven't done so, it is likely a good idea to go through the mailing lists or forums prior to posting these kinds of bugs.  The reason: There is a good chance someone will be able to provide you with a reasonable workaround.
Comment 5 Robin Stocker CLA 2010-12-06 09:02:59 EST
A workaround is to call detach() before merge(). But that shouldn't be necessary, right? That's what this bug is about.
Comment 6 Tom Ware CLA 2010-12-09 09:11:22 EST
Setting target and priority.  See the following page for the meanings of these fields:

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