Hi James,

Reply button broken? ;-)

I prefer your solution to adding a close method NodeRevisionContent. Because close would only be functional in a very small number of cases. During normal useage - using the input stream (and closing it), or getting the byte array - calling close would be superfluous. Another possible solution is to subclass NodeRevisionContent and lazy-initialize the input stream whenever it is used. This probably would need a change to RDBMSAdapter interface (retrieveRevisionContent should return an InputStream instead of NodeRevisionContent) and some changes to NodeRevisionContent. WDYT?

--
Unico


Oliver Zeigermann wrote:

---------- Forwarded message ----------
From: James Mason <[EMAIL PROTECTED]>
Date: Fri, 19 Nov 2004 19:41:24 -0800
Subject: Re: Unreleased database connections reading namespace
To: [EMAIL PROTECTED]


How about adding this to the javadoc for ContentHelper.retrieve() and NodeRevisionContent?

-James



On Fri, 2004-11-19 at 17:54 +0100, 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]



Reply via email to