Answers inline: From:
flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of thunderstumpgesatwork I'm using Data Services with Managed Objects and the
Hibernate Assembler. When you are using an association
property, you need to explicitly modify that property for it to change. The
“auto refresh” behavior of collections only works for collections which
you populate using the DataService.fill method. So in this case, you would
have to both create a new B and add it to A’s collection of B’s for
the A.Bcollection property to update. This could be done on the client, or
you could do it in on the server using the DataServiceTransaction api. It
might look at the newly created B and issue updateItem calls for the A destination
updating the collection property to include the new B. Assuming “autoSyncEnabled”
was true for the fill/getItem that created A, this would then push out the changes
to A’s collection of Bs so it shows up. I suppose that if adding B
has a side effect of updating the state of a property of A because of a
relationship in the database, simply refreshing A would also get the new version
of the data (i.e. call fill or getItem again) Yes, if you are using
association properties this is by manually updating association properties. Another
approach is to use fills instead of associations. In this case, you can
pass in the id of item “A” as a fill parameter to retrieve a list
of Bs instead of storing the collection of B’s as a property of A. In
this case, after each change to a B, we will go through all fills which have
auto-refresh enabled and re-execute them to see if their contents have changed.
If so, we push out the changes to the clients that have those fills. This
can be slow as the number of fills changes so there are ways to optimize that
process. I hope this helps. Does
this work for you if you are using hibernate without FDMS? I guess
it might if you are not caching instances and refetch them from the database
each time you create a new B… I think that usually you implement
this type of thing with a bi-directional relationship where B also has a
reference to one or more As. In this case, the hibernate docs recommend
that you update both sides of the relationship though only one of the
properties needs to be changed to persist the state in the database. Jeff -- 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
YAHOO! GROUPS LINKS
__,_._,___ |