Details
-
Type:
Sub-task
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.1-beta1
-
Fix Version/s: 1.1-beta3
-
Component/s: Persistence
-
Labels:None
-
Environment:Debian Linux, OpenJDK 6, Grails 1.1 SNAPSHOT
-
Testcase included:yes
Description
The beforeInsert closure on domain classes is now being called not only when the object is persisted for the first time, but also on every update.
This likely has to do with the changes to ClosureEventTriggeringInterceptor.groovy in r7405, since the closure is called unconditionally from the onSaveOrUpdate handler.
i have tested all events and it seems that only afterUpdate is affected. onSaveOrUpdate is called before onPreUpdate
Maybe intercepting onPreInsert instead of onSaveOrUpdate will do the trick here (keeping the code from onSaveOrUpdate)
timestamping is handled by onPreUpdate seperately anyway