On Monday 07 April 2008, Sica, David (David) wrote: > I'm creating a web service that needs to do some processing that will > take too long to perform and return to the client synchronously. I'm > considering giving the client back a transactionid immediately, > storing it in a database, then spawning a thread which will do the > long running task and update the database mapping between the > transactionid and the results which the client can query later. > > My main question is if there's anything special I should consider > about spawning threads from a CXF web service in this fashion or if > this is a bad idea? > > Thanks, > David
That should all work perfectly. Another option to consider though: if the clients are in a position where they can open a port/service, you COULD have the client create a callback service and pass the WSA refernce to that service to the server. When the server is done, it would just call back on the callback to say "done". That does require the server to be able to open ports back to the client though. That could be problematic with firewalls/routers and such. Couple notes: 1) We have a callback demo that show this. 2) This will be easier with 2.1 as the WSA support is built right into the JAX-WS API's. No need to drop to CXF proprietary stuff. -- J. Daniel Kulp Principal Engineer, IONA [EMAIL PROTECTED] http://www.dankulp.com/blog
