RE: [coldbox:7650] Re: Need Testers

The latest commit fixed this. Great work Luis.

Thanks,
Curt

Luis, if these optimizations are things we could apply to our own
code, it'd be great if you could write up something about the
principles involved, if you get a chance.

Thanks,
Dave

Hi Luis,

I ran a few more tests and am encountering this error when using BeanFactory.populateBean()

Here is my handler:

function createGroup(event){
var rc = event.getCollection();

//create the group
var group = ORMservice.new(“Group”);
rc.groupname = rc.name;
// Populate Group with the user’s input
BeanFactory.populateBean(target=group,include=‘userid,groupname,description,telephone’);

rc.results.setData(groupService.getGroup(group.getGroupID()));

}

And the error:

“ERROR”,“FILELOG”,“01/12/2011”,“14:55:28”,“MyApp”,“ColdBox Proxy Exception CFErrorType=org.hibernate.TransientObjectException CFMessage=object references an unsaved transient instance - save the transient instance before flushing: coldfusion.orm.PersistentTemplateProxy CFStackTrace=org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: coldfusion.orm.PersistentTemplateProxy
at org.hibernate.impl.SessionImpl.throwTransientObjectException(SessionImpl.java:1894)
at org.hibernate.impl.SessionImpl.getEntityName(SessionImpl.java:1888)
at coldfusion.orm.hibernate.SessionWrapper.getEntityName(SessionWrapper.java:238)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at coldfusion.runtime.StructBean.invoke(StructBean.java:508)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2393)
at cfAutowire2ecfc331309379$funcPROCESSENTITYINJECTION.runFunction(/Library/WebServer/Documents/myapp/frameworks/coldbox/system/interceptors/Autowire.cfc:154)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2547)
at cfAutowire2ecfc331309379$funcORMPOSTNEW.runFunction(/Library/WebServer/Documents/myapp/frameworks/coldbox/system/interceptors/Autowire.cfc:112)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:496)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:355)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2301)
at coldfusion.tagext.lang.InvokeTag.doEndTag(InvokeTag.java:389)
at cfInterceptorState2ecfc438163842$funcINVOKER.runFunction(/Library/WebServer/Documents/myapp/frameworks/coldbox/system/web/context/InterceptorState.cfc:139)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2582)
at cfInterceptorState2ecfc438163842$funcPROCESS.runFunction(/Library/WebServer/Documents/myapp/frameworks/coldbox/system/web/context/InterceptorState.cfc:86)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:337)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2360)
at cfInterceptorService2ecfc77043248$funcPROCESSSTATE.runFunction(/Library/WebServer/Documents/myapp/frameworks/coldbox/system/web/services/InterceptorService.cfc:105)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:337)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2360)
at cfColdboxProxy2ecfc1344579974$funcANNOUNCEINTERCEPTION.runFunction(/Library/WebServer/Documents/myapp/frameworks/coldbox/system/remote/ColdboxProxy.cfc:140)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2582)
at cfEventHandler2ecfc1147695631$funcPOSTNEW.runFunction(/Library/WebServer/Documents/myapp/frameworks/coldbox/system/orm/hibernate/EventHandler.cfc:25)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:337)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2360)
at cfBaseORMService2ecfc2109506308$funcNEW.runFunction(/Library/WebServer/Documents/myapp/frameworks/coldbox/system/orm/hibernate/BaseORMService.cfc:268)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:337)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2360)
at cfGroup2ecfc666986953$funcCREATEGROUP.runFunction(/Library/WebServer/Documents/myapp/handlers/Group.cfc:56)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:496)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:355)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2301)
at coldfusion.tagext.lang.InvokeTag.doEndTag(InvokeTag.java:389)
at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2723)
at cfController2ecfc2049480909$funcINVOKER.runFunction(/Library/WebServer/Documents/myapp/frameworks/coldbox/system/web/Controller.cfc:684)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2582)
at cfController2ecfc2049480909$funcRUNEVENT.runFunction(/Library/WebServer/Documents/myapp/frameworks/coldbox/system/web/Controller.cfc:571)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:517)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:496)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:355)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2301)
at cfColdbox2ecfc1265427057$funcPROCESSCOLDBOXREQUEST.runFunction(/Library/WebServer/Documents/myapp/frameworks/coldbox/system/Coldbox.cfc:238)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:337)
at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2360)
at cfApplication2ecfc1523304759$funcONREQUESTSTART.runFunction(/Library/WebServer/Documents/myapp/Application.cfc:79)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472)
at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405)
at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368)
at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55)
at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321)
at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:491)
at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:337)
at coldfusion.runtime.AppEventInvoker.invoke(AppEventInvoker.java:88)
at coldfusion.runtime.AppEventInvoker.onRequestStart(AppEventInvoker.java:258)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:349)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:94)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:79)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62)
at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:126)
at coldfusion.CfmServlet.service(CfmServlet.java:200)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:286)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
CFTagContext=ID: CF_STRUCTBEAN; LINE: 154; TEMPLATE: /Library/WebServer/Documents/myapp/frameworks/coldbox/system/interceptors/Autowire.cfc ID: CF_UDFMETHOD; LINE: 112; TEMPLATE: /Library/WebServer/Documents/myapp/frameworks/coldbox/system/interceptors/Autowire.cfc ID: CFINVOKE; LINE: 139; TEMPLATE: /Library/WebServer/Documents/myapp/frameworks/coldbox/system/web/context/InterceptorState.cfc ID: CF_UDFMETHOD; LINE: 86; TEMPLATE: /Library/WebServer/Documents/myapp/frameworks/coldbox/system/web/context/InterceptorState.cfc ID: CF_TEMPLATEPROXY; LINE: 105; TEMPLATE: /Library/WebServer/Documents/myapp/frameworks/coldbox/system/web/services/InterceptorService.cfc ID: CF_TEMPLATEPROXY; LINE: 140; TEMPLATE: /Library/WebServer/Documents/myapp/frameworks/coldbox/system/remote/ColdboxProxy.cfc ID: CF_UDFMETHOD; LINE: 25; TEMPLATE: /Library/WebServer/Documents/myapp/frameworks/coldbox/system/orm/hibernate/EventHandler.cfc ID: CF_TEMPLATEPROXY; LINE: 268; TEMPLATE: /Library/WebServer/Documents/myapp/frameworks/coldbox/system/orm/hibernate/BaseORMService.cfc ID: CF_TEMPLATEPROXY; LINE: 56; TEMPLATE: /Library/WebServer/Documents/myapp/handlers/Group.cfc ID: CFINVOKE; LINE: 684; TEMPLATE: /Library/WebServer/Documents/myapp/frameworks/coldbox/system/web/Controller.cfc ID: CF_UDFMETHOD; LINE: 571; TEMPLATE: /Library/WebServer/Documents/myapp/frameworks/coldbox/system/web/Controller.cfc ID: CF_TEMPLATEPROXY; LINE: 238; TEMPLATE: /Library/WebServer/Documents/myapp/frameworks/coldbox/system/Coldbox.cfc ID: CF_TEMPLATEPROXY; LINE: 79; TEMPLATE: /Library/WebServer/Documents/myapp/Application.cfc”
“ERROR”,“FILELOG”,“01/12/2011”,“14:55:28”,“v01.handlers.Group”,“The action:createGroup failed: object references an unsaved transient instance - save the transient instance before flushing: coldfusion.orm.PersistentTemplateProxy ExtraInfo:<?xml version="1.0" encoding="UTF-8"?>”

I’ve tested this against a number of handlers which are using BeanFactory, and they all produce the same error.

Thoughts?

Thanks.

Nolan

We fixed this issue this AM, did you update your core?

Nope! Late last night. Updating now!

Thanks.

Updated and all is working fine now.

Cheers.

Nolan

wow. what a difference. really... wow.

good job Louis!

How where your tests adk? Anything to share the group?

So Luis,

Where is the blog post outlining the changes you made, how you came to them, and why they are so much faster? ;o)

Come on, hop to… you can’t spend all your days making all our apps go crazy fast…

360.gif

Mark

Lol True. Will definitely start on it for sure.

Dude, I need some of whatever makes you such a mad coder. I know you
have a little one. Mine just turned 4 and I'm still recovering. I'm
continually amazed at both the quality and quantity of the work you
put out Luis, especially considering you're a new father. Brilliant
job, Sir.

Thanks Judah

This is my inspiration:

hi everybody, another round of performance updates again committied.

This time for cachebox and logbox and they are running sweet.

I also made two major updates to the plugin service and renderer. The
view and plugin resolution is now cached, so it should dramatically
improve plugin creation and view and layout renderings.

Please try them out.

Sweet. I’ll perform the same test this evening.

I have several entities that have one-to-many properties.

The properties are accessible and fully functional via entity.getProperties(). The result is an array with all of the related entities.

However, I’m not exactly sure where this is failing, but when I use the remote proxy, these values are always null.

I tried disabling lazy loading, but they are still null.

For example:

I have an entity User with a property trips. Trips is defined as such:

property name=“trips” singularName=“Trip” type=“array” fieldtype=“one-to-many” cfc=“model.commute.Trip” fkcolumn=“userID” inverse=“true” lazy=“false” cascade=“all-delete-orphan”;

When debugging the result from my remote proxy in Flex, as I said above, the result of the trips property in the User instance is always null. However, if I use getTrips() on the user, i get the appropriate results (see “USERTRIPS” in the link below).

http://screencast.com/t/EafjX9pF0

Basically my question is: Is there a way to dictate what relationships are loaded when loading an ORM Entity?

I have to do this for a lot of different properties throughout my application so that Flex can have access to all the necessary data. If I have to manually load every relationship, I might go insane.

Thanks in advance for any help!

Regards,

Ben

If I remember correctly, maybe the flex serializer is calling set on the property and setting it to null?

This is correct

I just figured it out: remotingfetch=“true” needs to be added to the attributes…

did you set it to true or false?

set it to true… it seems to override any lazy loading settings. So, for ColdBox purposes, I can keep it to false and when CF serializes it to AMF, the relationships are automatically loaded.

My trips property is now set like this:

property name=“trips” singularName=“trip” type=“array” fieldtype=“one-to-many” cfc=“model.commute.Trip” fkcolumn=“userID” inverse=“true” lazy=“true” remotingfetch=“true” cascade=“all-delete-orphan”;

Is there a way you can expand on this like a guide? I would love to add it to the docs recipes section