Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311225 - jpa validation failure with callback
Summary: jpa validation failure with callback
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-30 14:15 EDT by Sherry Hill CLA
Modified: 2022-06-09 10:29 EDT (History)
1 user (show)

See Also:


Attachments
Patch (1.31 KB, patch)
2010-04-30 15:47 EDT, Gordon Yorke CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sherry Hill CLA 2010-04-30 14:15:09 EDT
Build Identifier: 2.0.2.v20100323-r6872

Persisted employee of long name without proper validation on
Eclipse Persistence Services - 2.0.2.v20100323-r6872.
This is a regression from 2.0.1.v20100213-r6600. 

Reproducible: Always

Steps to Reproduce:
Please see the steps to reproduce failure and test source in
https://glassfish.dev.java.net/issues/show_bug.cgi?id=11831
Comment 1 Gordon Yorke CLA 2010-04-30 14:57:13 EDT
This issue exists because the initialization code was not updated to support initializing the hasAnyEventListeners when validation listeners were added.  Subsequent changes to initialize the DescriptorEventManager reset the bootstrap setting of this flag.

The easiest workaround is to add an entity listener to the Entity being validated.  Another workaround is to manually cause the flag within the DescriptorEventManager for the validated descriptor  to be set on.  Do this by adding a 'dummy' Listener then removing it.

DescriptorEventAdapter dummyListener = new DescriptorEventAdapter();
DescriptorEventManager eventManager = em.unwrap(Session.class).getDescriptor(Employee.class).getDescriptorEventManager();
eventManager.addListener(dummyListener);
eventManager.removeListener(dummyListener);
Comment 2 Gordon Yorke CLA 2010-04-30 15:47:14 EDT
Created attachment 166672 [details]
Patch

Adds code that checks for Internal Listeners during initialization.
Comment 3 Gordon Yorke CLA 2010-05-03 08:57:18 EDT
Patch checked in, Reviewed by Mitesh Meswani, verified using existing tests
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:29:27 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink