Community
Participate
Working Groups
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
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);
Created attachment 166672 [details] Patch Adds code that checks for Internal Listeners during initialization.
Patch checked in, Reviewed by Mitesh Meswani, verified using existing tests
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink