You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Jonathan Bayle <jo...@gael.fr> on 2016/01/06 10:22:29 UTC

ODataResponse steam not closed

Hi,

Using Olingo 2.0.5, are streams carried by an 
org.apache.olingo.odata2.api.processor.ODataResponse properly closed?

In my use case, I serve files via OData (through readEntityMedia), but 
file descriptors on these files are not released by the JVM.

Is there something special to do?

Thanks.
Jonathan.

Re: ODataResponse steam not closed

Posted by "Bolz, Michael" <mi...@sap.com>.
Hi Jonathan,

No problem and thanks for sharing the solution   ;o)

Best Regards,
Michael


> On 07 Jan 2016, at 11:33, Jonathan Bayle <jo...@gael.fr> wrote:
> 
> Hi Michael,
> 
> We are using org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet.
> 
> The steam is certainly not closed because of an InputStream decorator we use for quota restrictions.
> 
> Thanks, sorry for the noise.
> Jonathan.
> 
> On 07/01/2016 10:50, Bolz, Michael wrote:
>> Hi Jonathan,
>> 
>> Do you use the "org.apache.olingo.odata2.core.servlet.ODataServlet” or the “org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet”?
>> 
>> For the “ODataServlet” the InputStream is closed in the “handleStream(..)” method when the response is prepared.
>> For the “CXFNonSpringJaxrsServlet” the stream handling is done in CXF and there the stream should also be closed.
>> 
>> How do you access/open the files and provide the data?
>> Can you please share a short code snippet?
>> 
>> Best Regards,
>> Michael
>> 
>> 
>>> On 06 Jan 2016, at 10:22, Jonathan Bayle <jo...@gael.fr> wrote:
>>> 
>>> Hi,
>>> 
>>> Using Olingo 2.0.5, are streams carried by an org.apache.olingo.odata2.api.processor.ODataResponse properly closed?
>>> 
>>> In my use case, I serve files via OData (through readEntityMedia), but file descriptors on these files are not released by the JVM.
>>> 
>>> Is there something special to do?
>>> 
>>> Thanks.
>>> Jonathan.
> 


Re: ODataResponse steam not closed

Posted by Jonathan Bayle <jo...@gael.fr>.
Hi Michael,

We are using org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet.

The steam is certainly not closed because of an InputStream decorator we 
use for quota restrictions.

Thanks, sorry for the noise.
Jonathan.

On 07/01/2016 10:50, Bolz, Michael wrote:
> Hi Jonathan,
>
> Do you use the "org.apache.olingo.odata2.core.servlet.ODataServlet” or the “org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet”?
>
> For the “ODataServlet” the InputStream is closed in the “handleStream(..)” method when the response is prepared.
> For the “CXFNonSpringJaxrsServlet” the stream handling is done in CXF and there the stream should also be closed.
>
> How do you access/open the files and provide the data?
> Can you please share a short code snippet?
>
> Best Regards,
> Michael
>
>
>> On 06 Jan 2016, at 10:22, Jonathan Bayle <jo...@gael.fr> wrote:
>>
>> Hi,
>>
>> Using Olingo 2.0.5, are streams carried by an org.apache.olingo.odata2.api.processor.ODataResponse properly closed?
>>
>> In my use case, I serve files via OData (through readEntityMedia), but file descriptors on these files are not released by the JVM.
>>
>> Is there something special to do?
>>
>> Thanks.
>> Jonathan.


Re: ODataResponse steam not closed

Posted by "Bolz, Michael" <mi...@sap.com>.
Hi Jonathan,

Do you use the "org.apache.olingo.odata2.core.servlet.ODataServlet” or the “org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet”?

For the “ODataServlet” the InputStream is closed in the “handleStream(..)” method when the response is prepared.
For the “CXFNonSpringJaxrsServlet” the stream handling is done in CXF and there the stream should also be closed.

How do you access/open the files and provide the data?
Can you please share a short code snippet?

Best Regards,
Michael


> On 06 Jan 2016, at 10:22, Jonathan Bayle <jo...@gael.fr> wrote:
> 
> Hi,
> 
> Using Olingo 2.0.5, are streams carried by an org.apache.olingo.odata2.api.processor.ODataResponse properly closed?
> 
> In my use case, I serve files via OData (through readEntityMedia), but file descriptors on these files are not released by the JVM.
> 
> Is there something special to do?
> 
> Thanks.
> Jonathan.