Returning a Transient from a Web Service

For questions and postings not covered by the other forums
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Returning a Transient from a Web Service

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:55 pm

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.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Returning a Transient from a Web Service

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:55 pm

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.

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Returning a Transient from a Web Service

Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:55 pm

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.

User avatar
Dr Danyo
Posts: 56
Joined: Fri Aug 21, 2009 8:59 am

Re: Returning a Transient from a Web Service

Postby Dr Danyo » Wed Jan 27, 2010 3:30 am

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.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 16 guests

cron