db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <Knut.Hat...@Sun.COM>
Subject Re: Wondering to myself about doing layer B streaming from client to server
Date Fri, 30 Jun 2006 22:56:42 GMT
TomohitoNakayama <tomonaka@basil.ocn.ne.jp> writes:

> Hello.
> Continuing DERBY-1301(http://issues.apache.org/jira/browse/DERBY-1301),
> I came to have question whether layer B streaming should be done when
> lob was sent from client to server.
> Reading javadoc for java.sql package, I found that methods passing
> stream object to driver always takes parameter for length information.
> Then, driver can simply pass that length information to server.
> I think there are no need for driver to execute layer B streaming,
> because caller of driver always pass length of streamed object to driver.

Hi Tomohito,

I don't know how it relates to layer B streaming, but JDBC 4.0 will
add methods with a stream parameter and no length parameter. The
javadocs at http://download.java.net/jdk6/docs/api/ have not been
updated with these methods yet, but I believe they will be in a week
or two. You can find more details in DERBY-1417.

> However, here comes another question.
> DERBY-550(http://issues.apache.org/jira/browse/DERBY-550), which is
> linked from DERBY-1301 told that
> current implementation of org.apache.derby.jdbc.ClientDriver expands
> object to be streamed into memory and
> this behavior tends to cause OutOfMemoryError.
> Are there any reason why current driver expands object into memory,
> though length of the object is served as parameter of method ?

Probably because it was the easiest way to implement it. I don't see
any good technical reasons for doing it like that.

> Well....
> I think it is needed to survey some more around current implementation
> of driver and
> clear the mystery in org.apache.derby.jdbc.ClientDriver, around
> expanding object into memory before sending ....

It would be great to improve the stream handling on the client. I have
just briefly looked at the code, but it seems clear that this is a
part of the code that has room for improvement. Thanks for looking
into it!

Knut Anders

View raw message