It sounds like you do not have association tags in
data-management-config.xml for each of these relationships and so are
using the "hierarchical values" approach for managing the hierarchical
data.   This approach can save hierarchical stuff to hibernate fine if
your hibernate associations have the "save-update" flag - since
hibernate cascades the save operation down the object graph.. it will
save the employee even when the change is made to the company.  This
approach also can push these changes to other clients but only when you
modify them via the parent - i.e. in this case, you'd have to modify
company.departments[i].employees and only another client that had
retrieved the same company would see the new employee get pushed to it.


 

If you are doing a query to get the employees directly, data management
won't know it is the same employee and so those clients would not get
that pushed change.

 

For this more granular approach, you need to define the associations in
your data-management-config.xml to match the associations in your
hibernate configuration.   That way DMS knows the ids of each entity,
the data types and stuff like that and can keep everyone in sync.

 

Jeff

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Kevin
Sent: Tuesday, November 20, 2007 5:11 PM
To: [email protected]
Subject: [flexcoders] Need Help with DataServices pushing data to nested
collections

 

We are trying to use a hierarchical approach with DataServices but 
are having trouble with our nested VO collections. The data is 
getting properly saved to the database (via Hibernate) but the data 
pushing is not happening once we get more than one level deep in the 
collections. Here is an example:

Company contains a collection of Departments -> added Departments get 
pushed properly to the clients as expected.

Department contains a collection of Employees -> added Employees 
get recorded in the database BUT DONT get pushed to clients

Employee contains a collection of Schedules-> added 
Schedules get recorded in the database BUT DONT get pushed to the 
clients.

Currently there is only one destination for Companies which then (as 
I understand it) should manage it's child collections. As you can 
see the management seems to be working OK, but not the data pushing 
once we get more than one level deep in the collections.

Is there something that we may be missing here in our setup or 
assumptions? Any ideas would help as we are on a tight schedule to 
finish this part of the app before the Thanksgiving break 
(tomorrow!!) If you need to see our code let me know and I will paste 
some. Of course, I am assuming that there must be a way to get data 
pushing to work with deeply nested collections.

Thanks!

- Kevin

 

Reply via email to