Page 1 of 1

Returning a Transient from a Web Service

Posted: Fri Aug 07, 2009 12:55 pm
by ConvertFromOldNGs
by Mike May >> Fri, 11 Nov 2005 15:31:05 GMT

This may sound daft, but is it definitely OK to create and return a transient in a web service and then delete that transient in the epilog? I don't want unreferenced transients hanging around, and I don't want to delete an object that Jade may be using to populate the XML response.

Re: Returning a Transient from a Web Service

Posted: Fri Aug 07, 2009 12:55 pm
by ConvertFromOldNGs
by Mike May >> Fri, 11 Nov 2005 17:23:30 GMT

Silly question - should have tried it first. If I delete the transient, I get no data returned, if I don't, I do - Jade must (hopefully) delete it for me.

Re: Returning a Transient from a Web Service

Posted: Fri Aug 07, 2009 12:55 pm
by ConvertFromOldNGs
by dcooper@jade.co.nz >> Sat, 12 Nov 2005 6:01:11 GMT

Yes, JADE automatically deletes any transients returned from a webService method once the reply has been built. If you want to disable this default behaviour, set the deleteTransientReturnType property on your JadeWebServiceProvider subclass to false.

Dean.

Re: Returning a Transient from a Web Service

Posted: Wed Jan 27, 2010 3:30 am
by Dr Danyo
It’s worth pointing out that the mechanism that deletes the returned transient object, only applies to the high level object (i.e. a shallow delete) and that any reference transient objects will need to be deleted, either via a parent - child relationship or a destructor on the high level object.

For example JADE will delete the returned CompanyDTO object, but you will need to cater for the CompanyDTO::allEmployeeDTO objects (and any objects they reference) yourself.

- Dr Danyo.