Are you using either the “version” or “timestamp” features of hibernate?   This causes improper conflicts to be detected in the GMC version (though we have fixed this already in house).  To workaround that problem, you can turn off conflict detection:

 

                <update-conflict-mode>NONE</update-conflict-mode>

 

in your destination’s <server> tag.   If that is not a suitable workaround, let me know.   We distribute the HibernateAssembler source so I could send you a version with the fix in it.

 

I may also see the problem with the lazy initialization exception… there is code in the hibernate assembler which goes through and does a “deep fetch” of all properties which are not lazy=”true” associations in FDS’s configuration.  Hibernate by default has all of its properties marked with its own setting of lazy=”true” which means that those properties are not fetched when the parent object is fetched.  Since we need to serialize the state of all non-lazy properties and do not want to keep the hibernate session open for this process, we do this deep fetch ahead of time to be sure the state will be available for sending to the client.  Unfortunately, when we are throwing a DataSyncException for the conflict we are not doing the fetch of the object properties for the “serverVersion” of the object which also gets sent back to the client.  If my theory is correct, this error will go away when the conflict goes away but of course it still needs to be fixed.   I just made this fix locally so I could send that along as well.  

 

Jeff

 


From: [email protected] [mailto:[email protected]] On Behalf Of Thunder Stumpges
Sent: Wednesday, August 23, 2006 6:05 PM
To: [email protected]
Subject: [flexcoders] FDS + Hibernate exception committing updates

 

Hi all,

I have loaded a collection of managed objects, made some changes to
one of them, and called the DataService.commit() to commit these
changes back to the database.

My DataService is connected to a HibernateAssembler destination, and
this destination worked to create the initial version of the objects,
however when I attempt to update them, I get this exception. I can
tell there was a data sync conflict (not sure why, I'm only using one
client, one session, one update to the object). However what concerns
me more is that it's attempting to do something afterwards, and I get
this Hibernate exception about the session being closed. Any ideas?
thanks in advance,
Thunder
____________________-

[Flex] 17:17:47.860 [DEBUG] [DataService.General] DataSyncException
processing message: Flex Message (flex.data.messages.DataMessage)
operation = update
id = ASObject(8582034){id=1156377452946003871262}
clientId = BBE8D031-993E-E344-F36B-3D89CE3F5AE7
correlationId = B51D63E2-AC1F-9B5F-4554-3D8A2A895B15
destination = Dashboard
messageId = 215422DE-07CE-6AB4-21AF-3D8A07CE87DF
timestamp = 1156378667672
timeToLive = 0
body =
[

[
visualizations
],
com.mycompany.config.presentation.Dashboard@1667df0,
com.mycompany.config.presentation.Dashboard@1d626a4
]
hdr(DSEndpoint) = my-rtmp
exception: flex.data.DataSyncException: Data Synchronization Conflict
conflictCause: Flex Message (flex.data.messages.DataMessage)
operation = update
id = ASObject(8582034){id=1156377452946003871262}
clientId = BBE8D031-993E-E344-F36B-3D89CE3F5AE7
correlationId = B51D63E2-AC1F-9B5F-4554-3D8A2A895B15
destination = Dashboard
messageId = 215422DE-07CE-6AB4-21AF-3D8A07CE87DF
timestamp = 1156378667672
timeToLive = 0
body =
[

[
visualizations
],
com.mycompany.config.presentation.Dashboard@1667df0,
com.mycompany.config.presentation.Dashboard@1d626a4
]
hdr(DSEndpoint) = my-rtmp
serverObject: com.mycompany.config.presentation.Dashboard@ac622a
propertyNames: [visualizations]
at flex.data.assemblers.HibernateAssembler.updateItem(HibernateAssembler.java:713)
at flex.data.adapters.JavaAdapter.doUpdateItem(JavaAdapter.java:504)
at flex.data.adapters.JavaAdapter.invokeAssemblerSync(JavaAdapter.java:391)
at flex.data.adapters.JavaAdapter.invokeBatchOperation(JavaAdapter.java:248)
at flex.data.adapters.JavaAdapter.invoke(JavaAdapter.java:232)
at flex.messaging.services.MessageService.serviceMessage(MessageService.java:138)
at flex.data.DataService.sendBatchToAdapter(DataService.java:1326)
at flex.data.DataService.serviceTransactedMessage(DataService.java:505)
at flex.data.DataService.serviceMessage(DataService.java:241)
at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:548)
at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:302)
at flex.messaging.endpoints.rtmp.AbstractRTMPServer.dispatchMessage(AbstractRTMPServer.java:682)
at flex.messaging.endpoints.rtmp.NIORTMPConnection$RTMPReader.run(NIORTMPConnection.java:665)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:643)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:668)
at java.lang.Thread.run(Thread.java:595)

[Flex] 17:17:47.891 [DEBUG] [DataService.Transaction] Rolledback transaction
Aug 23, 2006 5:17:47 PM org.hibernate.LazyInitializationException <init>
SEVERE: failed to lazily initialize a collection of role:
com.mycompany.config.presentation.Dashboard.dashboardcriterias, no
session or session was closed
org.hibernate.LazyInitializationException: failed to lazily initialize
a collection of role:
com.mycompany.config.presentation.Dashboard.dashboardcriterias, no
session or session was closed
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
at org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:97)
at org.hibernate.collection.PersistentSet.size(PersistentSet.java:114)
at java.util.ArrayList.<init>(ArrayList.java:133)
at flex.messaging.io.ArrayCollection.<init>(ArrayCollection.java:44)
at flex.messaging.io.amf.Amf3Output.writeArrayCollection(Amf3Output.java:407)
at flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:147)
at flex.messaging.io.amf.Amf3Output.writeObjectProperty(Amf3Output.java:215)
at flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java:495)
at flex.messaging.io.amf.Amf3Output.writeCustomObject(Amf3Output.java:467)
at flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:165)
at flex.messaging.io.amf.Amf3Output.writeObjectProperty(Amf3Output.java:215)
at flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java:495)
at flex.messaging.io.amf.Amf3Output.writeCustomObject(Amf3Output.java:467)
at flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:165)
at flex.messaging.io.amf.Amf3Output.writeObjectArray(Amf3Output.java:730)
at flex.messaging.io.amf.Amf3Output.writeAMFArray(Amf3Output.java:386)
at flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:151)
at flex.messaging.io.amf.Amf3Output.writeObjectProperty(Amf3Output.java:215)
at flex.messaging.io.amf.Amf3Output.writePropertyProxy(Amf3Output.java:495)
at flex.messaging.io.amf.Amf3Output.writeCustomObject(Amf3Output.java:467)
at flex.messaging.io.amf.Amf3Output.writeObject(Amf3Output.java:165)
at flex.messaging.io.amf.Amf0Output.writeObject(Amf0Output.java:157)
at flex.messaging.io.tcchunk.TCCommand.getCommandResponse(TCCommand.java:419)
at flex.messaging.endpoints.rtmp.AbstractRTMPServer.dispatchMessage(AbstractRTMPServer.java:752)
at flex.messaging.endpoints.rtmp.NIORTMPConnection$RTMPReader.run(NIORTMPConnection.java:665)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:643)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:668)
at java.lang.Thread.run(Thread.java:595)

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to