users@glassfish.java.net

Re: Problem with sending large amount of data

From: <glassfish_at_javadesktop.org>
Date: Thu, 29 May 2008 14:39:56 PDT

I'm not going to say its "impossible" because I don't know, but it's probably not recommended to send huge amounts of data via an RPC mechanism.

The big issue is that in a standard RPC message, both sides are likely to require the entire message to be in memory. They will also, most likely, duplicate the message. So if you have a 45MB byte array, it's probably going to duplicate that before sending it during the marshal phase, and similarly on the client it will copy it during the unmarshal phase.

As you can imagine, that's quite expensive.

The Web services layer handles large messages by rewriting them so the huge portions are attachments, which the server will spool to disk first, lowering the overall impact.

Is there any way you can simply save the data to the disk, and instead send a URL to the data that the client can download independent of the CORBA mechanism?
[Message sent by forum member 'whartung' (whartung)]

http://forums.java.net/jive/thread.jspa?messageID=277384