Title:
Bug 82785:When using EntitySave on a table with column defaults you often need to reload the data
| View in TrackerStatus/Resolution/Reason: Closed/Withdrawn/
Reporter/Name(from Bugbase): Eric Twilegar / Eric Twilegar (twillerror)
Created: 04/30/2010
Components: ORM Support
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 0000 /
Priority/Frequency: Normal / Unknown
Locale/System: English / Win All
Vote Count: 0
Problem:
When using EntitySave on a table with column defaults you often need to reload the data. You call EntitySave and then ORMFlush in order write to the database.In the model CFC you have columns with insert="false" and then that column has a default. ie. a column named Entered that stores the time the record was created. The database itself sets this value for consistency because front end cluster servers could have slightly different times.In some cases the object needs to be re-used directly on the page the page. Just calling ORMFlush will not load up the columns out of the database into the entity object.Calling EntityReload will pull this information out of the database.Using SQL Server profiler I see that EntityReload started loading up my many-to-one and one-to-many relationships even though lazy="true" is set.This is very similiar to the CFDUMP bug that ignores lazy loading. For my database in partciular this can be devastating. It can litterally take down the entire server as it loads 10,000's of objects in some of the relationships. I've generated my model objects in hopes that the auto generated methods for relationships ie. getSomeRelationShipTalbe() will eventually take a filter argument. For instance getItem().getOrders(). getOrders could litterally return 10,000 records if that item is involved in many many orders. calling getItem().getOrders(entered > '#now()#' ) could make it more useful.I'm not asking for that feature, but giving some context to why I have large relationships defined.Also, how many layers down does it go by default? It is loading relationships of relationships...and so forth.
Method:
Create a model objectCreate relationship with lazy="true' . Preferrable define large relationships or many-to-one that has a large one-to-many a layer down.Save an entity of that model with a relationship Call entityreload and wathc lazy be ignored.
Result:
No error message: EntityReload is ignorning lazy load.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3041397
Deployment Phase: Release Candidate
External Customer Info:
External Company:
External Customer Name: Eric Twilegar
External Customer Email: 3D9A02F5446CCE0A992015D5
External Test Config: 04/30/2010
Attachments:
Comments: