A close method for NodeRevisionContent sounds most reasonable for me.
Should be very easy to implement and would be backward compatible...
Oliver
On Fri, 19 Nov 2004 18:07:28 +0100, Unico Hommes <[EMAIL PROTECTED]> wrote:
> Perhaps the API would have been clearer without the NodeRevisionContent
> object and instead of Content.retrieve() we would have
> Content.retrieveAsBytes(), Content.retrieveAsStream(),
> Content.retrieveAsReader(). But I am not sure it is worth to change it.
> Another option is to add a close() method to NodeRevisionContent. Hmm.
>
> --
> Unico
>
>
>
> Oliver Zeigermann wrote:
>
> >Ah, this makes it clear!
> >
> >I know it is really not obvious that you have to close a stream you do
> >not even touch, but there really is no better solution I am afraid :(
> >
> >Same thing with the tx file store...
> >
> >Oliver
> >
> >On Fri, 19 Nov 2004 17:51:23 +0100, Unico Hommes <[EMAIL PROTECTED]> wrote:
> >
> >
> >>OK, I see now. It doesn't matter if you actually decide to use the
> >>NodeRevisionContent object. Once you retrieve it from the Content helper
> >>the stream must somehow be closed. I was conditionally using it and so
> >>connections were left open.
> >>
> >>Anyway, thanks again Oliver, you saved my day :-)
> >>
> >>--
> >>Unico
> >>
> >>
> >>
> >>Unico Hommes wrote:
> >>
> >>
> >>
> >>>Dude it worked! Thanks!
> >>>
> >>>I am reading the NodeRevisionContent like so:
> >>>
> >>>InputStream in = null;
> >>>try {
> >>> in = new ByteArrayInputStream(content.getContentBytes());
> >>>}
> >>>finally {
> >>> in.close();
> >>>}
> >>>
> >>>Perhaps something goes wrong during
> >>>NodeRevisionContent.getContentBytes() ? But it looks like that method
> >>>correctly closes the InputStream though.
> >>>
> >>>--
> >>>Unico
> >>>
> >>>Oliver Zeigermann wrote:
> >>>
> >>>
> >>>
> >>>>If you are not using compressed there will be an input stream in
> >>>>content that is the one from the JDBC driver and *must* be closed to
> >>>>close the connection. Try enabling compression if not already done and
> >>>>see if this changes anything.
> >>>>
> >>>>Oliver
> >>>>
> >>>>
> >>>>
> >>>>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >>
> >>
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
>
> ---------------------------------------------------------------------
>
>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]