--
You received this message because you are subscribed to the Google Groups "cf-orm-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cf-orm-dev+...@googlegroups.com.
To post to this group, send email to cf-or...@googlegroups.com.
Visit this group at https://groups.google.com/group/cf-orm-dev.
For more options, visit https://groups.google.com/d/optout.
One important thing I forgot to mention: this is an intermittent problem. Sometimes when I restart the server the cfc mappings are correct, other times I have this problem where seemingly only this single component has the incorrect mapping.
None of our CFC's declare EntityName, and we aren't always using the full name with EntityNew either. I'm making these changes now. When I try <cfcomponent entityName="com.model.ORM.EventQuestionLink">, I get the error: "A CFC with entityname EventQuestionLink could not be found." If I use <cfcomponent entityName="EventQuestionLink"> then there is no error.
Right now things are working smoothly... if you never hear from me again in this thread, your suggestion 2 must have been the fix.
This continues to be an intermittent, very frustrating problem.
In EventQuestionLink.cfc:
component extends="Entity" persistent="true" table="event_questions_link" schema="dbo" output="false" cacheuse="transactional" entityName="EventQuestionLink"
(I try using "com.model.ORM.EventQuestionLink" and "model.ORM.EventQuestionLink" for entityName, but both result in component not found error. Previously there was no entityName value.)
In EventService.cfc:
var newLink = new com.model.ORM.EventQuestionLink();
newLink.setEventID(arguments.eventID);
newLink.setQuestionID(questionID);
// var newLink = EntityNew("EventQuestionLink", {eventID:arguments.eventID, questionID:questionID});
writeDump(var=newLink,abort=true);
EntitySave(newLink);
The resulting WriteDump shows: "component model.ORM.EventQuestionLink extends com.model.ORM.Entity". I dump my ORMsettings struct and see that cfcLocation is correct. Ends up the same whether I use "new com.model.ORM.EventQuestionLink()" or "EntityNew('EventQuestionLink')" version.
I don't understand how EntityNew("EventQuestionLink") is working totally fine and knows what directory to get a new EventQuestionLink, but then EntitySave() wants to save it in the wrong place!
On application startup, sometimes this entity is mapped correctly, other times not.
Each region subdirectory contains a symlink to the upper com directory and an Application.cfc that sets this.ormSettings.cfcLocation = '/com/model/ORM'.
Each region subdirectory has an empty ApplicationProxy.cfc that extends Application.cfc. In /com an Application.cfc sets all common app settings and also extends ApplicationProxy.cfc. This way our "inner" Application.cfc includes ApplicationProxy, which is just there to include the "outer" Application.cfc (region specific app settings).
Hope this gives you something to go on. It seems to me that the mapping done on server start is happening inconsistently somehow? I have been trying moving the this.ormSettings.cfcLocation around between the inner/outer Application.cfc, but the intermittent nature of the problem is making it hard for me to tell what, if anything, my changes are doing... Might not even be looking in the right place! But my hunch is that this line is not being read early enough.
On Tuesday, June 21, 2016 at 2:54:59 PM UTC-5, Spencer Neff wrote:
cfclocation | Specifies the directory (or array of directories) that should be used by ColdFusion to search for persistent CFCs to generate the mapping. If cfclocation is set, ColdFusion looks at only the paths specified in it. If it is not set, ColdFusion looks at the application directory, its sub-directories, and its mapped directories to search for persistent CFCs. |
This continues to be an intermittent, very frustrating problem.
In EventQuestionLink.cfc:
component extends="Entity" persistent="true" table="event_questions_link" schema="dbo" output="false" cacheuse="transactional" entityName="EventQuestionLink"
Thanks for your help. Unfortunately, I likely won't be pursuing it anymore. We are anticipating moving production from ACF10 to Lucee5, so I'm taking this opportunity to switch now. I think the problem will go away... also now on orders to set up a Windows box.
On Tuesday, June 21, 2016 at 2:54:59 PM UTC-5, Spencer Neff wrote:
Thanks for your help. Unfortunately, I likely won't be pursuing it anymore. We are anticipating moving production from ACF10 to Lucee5, so I'm taking this opportunity to switch now.
I think the problem will go away... also now on orders to set up a Windows box.