Title:
Bug 83748:It seems that the ORM event handler now fires the preUpdate method twice when updating a persistent entity
| View in TrackerStatus/Resolution/Reason: Closed/Withdrawn/
Reporter/Name(from Bugbase): John Whish / John Whish (John Whish)
Created: 08/03/2010
Components: ORM Support
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 9,0,1,274733 /
Priority/Frequency: Trivial / Unknown
Locale/System: English / Platforms All
Vote Count: 0
Duplicate ID: CF-3041853
Problem:
It seems that the ORM event handler now fires the preUpdate method twice when updating a persistent entity. This did not happen in CF9.0. Example code to demonstrate is shown below.
Method:
Application.cfccomponent{ this.name = "preupdate_testcase"; this.datasource = "cfbookclub"; this.ormEnabled = true; this.ormSettings.eventHandling = true; this.ormSettings.flushatrequestend = false;}Author.cfccomponent persistent="true" table="Authors"{ property name="authorid" generator="native" fieldtype="id"; property name="firstname"; property name="lastname"; counter = 0; void function preUpdate( required struct oldData ) { counter++; trace( text="fired preUpdate #counter#", inline=true ); }}example.cfm<cfscript>transaction{ Author = EntityLoadByPK( "Author", 1 ); Author.setFirstName( "Mike #TimeFormat( Now(), "MM:SSt")#" ); EntitySave( Author );}</cfscript>When I run this on a ColdFusion 9.01 install, the trace I get is :[CFTRACE 22:09:44.421] [31 ms] [C:\htdocs\Aliaspooryorik\samples\preUpdate\Author.cfc @ line: 17] - fired preUpdate 1 [CFTRACE 22:09:44.421] [31 ms] [C:\htdocs\Aliaspooryorik\samples\preUpdate\Author.cfc @ line: 17] - fired preUpdate 2 Running this on a ColdFusion 9.00 install, the preUpdate only fires once (as I would expect).
Result:
preUpdate orm event handler fires twice when saving an entity. Didn't happen in CF9.0.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3041854
External Customer Info:
External Company:
External Customer Name: John Whish
External Customer Email: 4B9370D7448AB8BF9920157F
External Test Config: 08/03/2010
Attachments:
Comments: