Title:
Bug 78055:[JFERNANDES] ORM entities with related entities can't be sent over the wire to Flex applications since we get a stacktrace at blazeDS level
| View in TrackerStatus/Resolution/Reason: Closed/Fixed/
Reporter/Name(from Bugbase): João Fernandes / João Fernandes (Joao Fernandes)
Created: 06/19/2009
Components: ORM Support
Versions: 9.0
Failure Type: Unspecified
Found In Build/Fixed In Build: 0000 / 239764
Priority/Frequency: Major / Unknown
Locale/System: English / Platforms All
Vote Count: 0
Problem:
[JFERNANDES] ORM entities with related entities can't be sent over the wire to Flex applications since we get a stacktrace at blazeDS level.
Method:
First entity
<cfcomponent persistent="true" table="associacao" entityName="associacao" >
<cfproperty name="id" column="id" fieldtype="id" generator="increment" />
<cfproperty name="nome" column="nome" fieldtype="column" />
<cfproperty name="entidade_historico" fieldtype="one-to-many" cfc="entidade_historico" fkColumn="associacao_id" cascade="all-delete-orphan" />
</cfcomponent>
Second entity
<cfcomponent persistent="true" table="entidade_historico" entityName="entidade_historico" >
<cfproperty name="id" column="id" fieldtype="id" generator="increment" />
<cfproperty name="clube_id" column="clube_id" datatype="integer" fieldtype="column" />
<cfproperty name="associacao" column="associacao_id" datatype="integer" fieldtype="many-to-one" cfc="associacao" fkColumn="id" missingRowIgnored="true" inverse="true" insert="false" update="false" />
<cfproperty name="notas" column="notas" fieldtype="column" />
</cfcomponent>
Service to invoke
<cfcomponent >
<cffunction name="list" access="remote" returnType="array" >
<cfreturn EntityLoad("associacao") />
</cffunction>
</cfcomponent>
Result:
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: associacao.entidade_historico, no session or session was closed
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:380)
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:372)
at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:365)
at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:108)
at org.hibernate.collection.PersistentBag.toArray(PersistentBag.java:280)
at coldfusion.flash.messaging.io.amf.CFAMF3Output.writeAMFArray(CFAMF3Output.java:251)
at coldfusion.flash.messaging.io.amf.CFAMF3Output.writeObject(CFAMF3Output.java:163)
at flex.messaging.io.amf.Amf3Output.writeObjectProperty(Amf3Output.java:250)
at flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java:573)
at flex.messaging.io.amf.Amf3Output.writeCustomObject(Amf3Output.java:525)
at coldfusion.flash.messaging.io.amf.CFAMF3Output.writeObject(CFAMF3Output.java:80)
at flex.messaging.io.amf.Amf3Output.writeObjectArray(Amf3Output.java:825)
at coldfusion.flash.messaging.io.amf.CFAMF3Output.writeAMFArray(CFAMF3Output.java:251)
at coldfusion.flash.messaging.io.amf.CFAMF3Output.writeObject(CFAMF3Output.java:163)
at flex.messaging.messages.AbstractMessage.writeExternal(AbstractMessage.java:353)
at flex.messaging.messages.AsyncMessage.writeExternal(AsyncMessage.java:140)
at flex.messaging.messages.AcknowledgeMessage.writeExternal(AcknowledgeMessage.java:93)
at flex.messaging.messages.AcknowledgeMessageExt.writeExternal(AcknowledgeMessageExt.java:55)
at flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java:563)
at flex.messaging.io.amf.Amf3Output.writeCustomObject(Amf3Output.java:525)
at coldfusion.flash.messaging.io.amf.CFAMF3Output.writeObject(CFAMF3Output.java:80)
at coldfusion.flash.messaging.io.amf.CFAMF0Output.writeObject(CFAMF0Output.java:148)
at flex.messaging.io.amf.AmfMessageSerializer.writeObject(AmfMessageSerializer.java:196)
at flex.messaging.io.amf.AmfMessageSerializer.writeBody(AmfMessageSerializer.java:186)
at flex.messaging.io.amf.AmfMessageSerializer.writeMessage(AmfMessageSerializer.java:142)
at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:179)
at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:278)
at coldfusion.flash.messaging.CFAMFEndPoint.service(CFAMFEndPoint.java:202)
at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:322)
at coldfusion.flex.ColdFusionMessageBrokerServlet.service(ColdFusionMessageBrokerServlet.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
at coldfusion.filter.FlashRequestControlFilter.doFilter(FlashRequestControlFilter.java:71)
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)
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3038956
Deployment Phase: Release Candidate
External Customer Info:
External Company:
External Customer Name: João Fernandes
External Customer Email: 4E9A42C244586146992015D5
External Test Config: 06/19/2009
Attachments:
Comments: