cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aristedes Maniatis <...@ish.com.au>
Subject Re: Simple callback question
Date Fri, 24 Jul 2009 04:11:36 GMT
On 24/07/09 1:15 PM, Dave Lamy wrote:
> Should the preUpdate callback event get fired for both new and existing
> objects?
>
> The behavior I'm seeing (3.0M5) is that preUpdate is not getting called when
> saving my new object, but does get called when saving an existing object.
> prePersist is not the correct time for my event code to run.. I need to have
> this run during the commit phase, not during the creation phase.
>
> Please let me know if this is surprising or not.  And if not, do I have any
> choices to get the behavior I need?


That's how it works unfortunately. These callbacks follow the JPA standard, but they certainly
don't make the most sense. They are even less useful in ROP (three tier). You are going to
have to work within the confines of what is available [1] for now but there has been some
discussion of changing or adding new events.

Ari Maniatis


[1] http://cayenne.apache.org/doc/lifecycle-callbacks.html



-------------------------->
ish
http://www.ish.com.au
Level 1, 30 Wilson Street Newtown 2042 Australia
phone +61 2 9550 5001   fax +61 2 9550 4001
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

Mime
View raw message