It is not a good idea to return streams from EJBs. Most streams are not serializable (which doesn't really matter if you use local interfaces) and you don't want to keep certain resources open longer than necessary or leave them possibly unclosed. In general, you are asking for trouble if you go this route. What exactly are you passing around that is using so much memory? Quite possibly, EJB may not be a good solution in this particular case...
Joined: Mar 29, 2003
yes, may be i`m wrong using EJB for this task I have server(j-boss) with has connection thru jdbc to database, i need build report client side, for this i need data as resul ot query to data base so i see it as a pipe between client and database i`ll only get whoe result of query ( only moving forvard geting data) and build report using xslt i think about, may be i heed somethink like httpsession.....
Isnt it possible over here to create a Data object out of the result set and return that from the session bean? You can implement a paging logic on the data object if the data is too huge and your client can afford to do so. I think it will be an overkill to build a streaming solution for this sort of a thing. Having a data object with paging(fetch data on demand) will be more suitable.