I've been using the hibnerateassembler to update parent and insert child record into db on the lcds server and then using the beanproxy to try to push the updates back to the client. The parent update is received by the client but not the child record;
here's what I'm currently trying to do
BeanProxy proxy = new BeanProxy(parent)
BeanProxy bp = new BeanProxy(parent.getValue("child"));
DataServiceTransaction dtx = DataServiceTransaction.begin(false);
dtx.updateItem(ParentService, parent, oldParent, null);
dtx.commit(); // done telling lcds
what am I doing wrong?
thanks in advance
A few questions:
1. How are you declaring your destination in datamanagement-config.xml?
2. The above code also looks suspect and is incomplete: E.g. you have declared a proxy for the parent and child and don't even use it anywhere.
3. Also, why do you need a beanproxy, when you can directly pass the value object to DST. LCDS will ensure that the object is sent appropriately to the client. Try it out
Unfortunately the code fragment I posted is a temporary compromise between using the data management on the server and fml generated data access on the client. I've been unable to the the client fml generated code to recognize the hibernate assembler due to suspected differences between flashbuilder 4.5 and lcds 3.1. This was discussed in a prior post. I using the workaround of packing/unpacking client traffic using the bean proxy until I can upgrade everything to 4.6 (soon I hope).
At the time it was a single table so it wasn't too onerous, now we've refactored and added a child table.
To answer your questions the parent and child destinations are configured in the data management config and I'm using them in the sections of code that I didn't bother to post. I've using the pareent proxy for a while and just added the child proxy and this is what I'm trying to figure out now.
Reply-To: "firstname.lastname@example.org<mailto:email@example.com>" <firstname.lastname@example.org<mailto:email@example.com>>
Date: Fri, 20 Jan 2012 06:52:58 -0800
Subject: Re: how to push child record using beanproxy? how to push child record using beanproxy?
Re: how to push child record using beanproxy?
I got to this point from this discussion:
anyways we got the go ahead to upgrade to 4.6 and I'll be starting that effort soon so I may be able to clear this up
Europe, Middle East and Africa