Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » @postload problem : never called(@postload problem: never called)
@postload problem : never called [message #650517] Tue, 25 January 2011 06:56 Go to next message
jean marie turc is currently offline jean marie turc
Messages: 6
Registered: January 2011
Junior Member
hi all,

I have a problem with the annotation @postload: it is never called. !!
(I use the last official version of eclipselink and the problem already exist in the version before)

So I use @EntityListeners instead , and I implement "DescriptorEventListener" as:
public class LocationListener implements DescriptorEventListener {
	
	public void postBuild(DescriptorEvent arg0) {
		Location l = (Location) arg0.getSource();
		try {
			Tools.convertLocation(l);
		} catch (Exception e) {
			l.setName("Error " + e.getMessage());
		}
	}


But , sometime, the postBuild is not called too.
So it is a real problem.
Any idea ?
Thanks

Re: @postload problem : never called [message #650728 is a reply to message #650517] Wed, 26 January 2011 05:02 Go to previous messageGo to next message
jean marie turc is currently offline jean marie turc
Messages: 6
Registered: January 2011
Junior Member
About why sometime the postBuild is not called , I find this :
when the expiry time is passed, (so the cache is expired) , eclipse link does not call the postBuild of the entityListener.

Here is the object ;
Entity
@Table(catalog = "sdcarbrp", schema = "dbo", name = "v_car_list_location")
@EntityListeners( { LocationListener.class })
@Cache(type = CacheType.FULL, expiry = 3600000, shared = true)
public class Location implements Serializable, Comparable<Location> {
.....


So, in this example, after 1 hour, the postBuild methode will not be call by the listener.
I think it is a bug of eclipse link.

About why eclipselink never call the @postLoad : no idea for tjhe moment.

[Updated on: Wed, 26 January 2011 05:05]

Report message to a moderator

Re: @postload problem : never called [message #650832 is a reply to message #650728] Wed, 26 January 2011 13:21 Go to previous message
Chris Delahunt is currently offline Chris Delahunt
Messages: 1017
Registered: July 2009
Senior Member
Hello,

Sounds like you are seeing bug 273304 https://bugs.eclipse.org/bugs/show_bug.cgi?id=273304
This occurs when EclipseLink builds the object in the shared cache and then merges them into the managed entity. Is it that the postLoad is not called at all, or that it is called on the wrong entity (the object built for the shared cache)? You might try the workaround which is to also use the postMerge event as well as the postRefresh.

As for postBuild, it is specifically for when the object is built into the cache. If the object is invalid but still exists in the cache, it will not be fired, as this is a refresh event.

Best Regards,
Chris
Previous Topic:Beginner setup problems
Next Topic:Correlated ReportQuery using wrong alias in start with clause
Goto Forum:
  


Current Time: Thu Aug 21 04:16:06 EDT 2014

Powered by FUDForum. Page generated in 0.01540 seconds