Re: [RFC] How about changing the default value of defaultRowFetchSize?

Поиск
Список
Период
Сортировка
От Dave Cramer
Тема Re: [RFC] How about changing the default value of defaultRowFetchSize?
Дата
Msg-id CADK3HHJPyAtomOsds9CbxcFQjyN3t3Sc25vMEHXPA6PXDQwwZg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [RFC] How about changing the default value of defaultRowFetchSize?  (Mark Rotteveel <mark@lawinegevaar.nl>)
Список pgsql-jdbc
On 20 October 2016 at 13:51, Mark Rotteveel <mark@lawinegevaar.nl> wrote:
On 20-10-2016 17:59, Jorge Solórzano wrote:
On Thu, Oct 20, 2016 at 6:53 AM, Mark Rotteveel <mark@lawinegevaar.nl
<mailto:mark@lawinegevaar.nl>> wrote:


    In other words, PostgreSQL JDBC could
    ​​
    leave the default at 0, but then use a default fetch size.



That's seems wrong, the Fetch Size should be correctly reported, the
defaultRowFetchSize property can be changed to 100 but a call to
getFetchSize() should return 100 not 0.

Based on the driver docs:
"defaultRowFetchSize: Default parameter for
java.sql.Statement#getFetchSize(). A value of 0 means that need fetch
all rows at once"

The value of 0 should be used to fetch all rows, if we ​leave the
default at 0 and handle internally that as 100 (and reporting it as 0)
it is a wrong behavior.

My reply was purely from the perspective of the JDBC specification, not how the PostgreSQL JDBC driver currently implements it.

According to the JDBC specification:

"The methods getFetchDirection and getFetchSize return the current value of the hints. If either of these methods is called before the corresponding setter method has been called, the value returned is implementation-defined."

In other words, the default fetch size is implementation defined, furthermore the javadoc of Statement.setFetchSize implies that setting it to value 0 will revert to the default (whatever that is).

Even more of an argument to leave it returning 0 unless it is explicitly set





В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Mark Rotteveel
Дата:
Сообщение: Re: [RFC] How about changing the default value ofdefaultRowFetchSize?
Следующее
От: Mark Rotteveel
Дата:
Сообщение: Re: [RFC] How about changing the default value ofdefaultRowFetchSize?