Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » actually usable entity events
actually usable entity events [message #1012227] Thu, 21 February 2013 01:15 Go to next message
Tom Eugelink is currently offline Tom Eugelink
Messages: 806
Registered: July 2009
Senior Member
I've just embarked on a new project where we will be using JPA. One of the issues that I came across in previous projects is the fact that the EJB events are not really usable, because you often need to modify other entities and that is not supported. I've tried to find out if the events are going to be improved in a future JPA spec, but I cannot find an answer. But maybe the guys implementing the reference implementation do.

So: are there JPA entity events planned in a future spec where you can modify / persist / remove other entities?

Tom
Re: actually usable entity events [message #1014844 is a reply to message #1012227] Tue, 26 February 2013 10:15 Go to previous messageGo to next message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

I assume this will always be unspecified/provider specific in the Spec.

Depending on the event, and the modification, it may work.

EclipseLink also has its own set of SessionEvents and DescriptorEvents.

Somethings are better done in the application, instead of persistence events.


James : Wiki : Book : Blog : Twitter
Re: actually usable entity events [message #1014871 is a reply to message #1014844] Tue, 26 February 2013 11:09 Go to previous message
Tom Eugelink is currently offline Tom Eugelink
Messages: 806
Registered: July 2009
Senior Member
On 2013-02-26 16:15, James Sutherland wrote:
> I assume this will always be unspecified/provider specific in the Spec.
>
> Depending on the event, and the modification, it may work.
>
> EclipseLink also has its own set of SessionEvents and DescriptorEvents.
>
> Somethings are better done in the application, instead of persistence events.
>


Too bad. What would be great is that the events would be fired on all entities before they are written to the database. That would allow for changes being made to other entities.

I've initially indeed adopted Eclipse's events to do this, but ended up with an extended entity manager to generate them. Especially cascade remove is something that is hard to do in an application.
Previous Topic:How to create a history for a Many To Many relationship?
Next Topic:ClassWeaver generates buggy code ?
Goto Forum:
  


Current Time: Sat Apr 19 13:25:28 EDT 2014

Powered by FUDForum. Page generated in 0.01526 seconds