pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
PostgreSQL, WebObjects and fetchSize
8+ messages / 4 participants
[nested] [flat]

* PostgreSQL, WebObjects and fetchSize
@ 2005-05-11 13:47  Jan Willem Luiten <jwl@secondmove.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Jan Willem Luiten @ 2005-05-11 13:47 UTC (permalink / raw)
  To: pgsql-jdbc

Hello,

I just recently installed PostgreSQL. I'm using this in combination  
with WebObjects 5.2. and am fairly impressed with Postgres.  
Unfortunately I ran into a problem. I have a table containing a large  
number of rows ( > 600.000). When using a displaygroup for batched  
access I get an Out of Memory error.

This seems to be caused by the jdbc adaptor reading the complete  
resultset instead of using a scrollable cursor. Is there a way to  
solve this, eg by setting the fetchsize in some way?

Kind regards,

Jan Willem Luiten



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: PostgreSQL, WebObjects and fetchSize
@ 2005-05-11 13:59  Oliver Jowett <oliver@opencloud.com>
  parent: Jan Willem Luiten <jwl@secondmove.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Oliver Jowett @ 2005-05-11 13:59 UTC (permalink / raw)
  To: Jan Willem Luiten <jwl@secondmove.com>; +Cc: pgsql-jdbc

Jan Willem Luiten wrote:

> This seems to be caused by the jdbc adaptor reading the complete 
> resultset instead of using a scrollable cursor. Is there a way to  solve
> this, eg by setting the fetchsize in some way?

Yes: Statement.setFetchSize(). Currently it only takes effect with
autocommit off and TYPE_FORWARD_ONLY resultsets.

-O



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: PostgreSQL, WebObjects and fetchSize
@ 2005-05-11 14:17  Jan Willem Luiten <jwl@secondmove.com>
  parent: Oliver Jowett <oliver@opencloud.com>
  0 siblings, 1 reply; 8+ messages in thread

From: Jan Willem Luiten @ 2005-05-11 14:17 UTC (permalink / raw)
  To: pgsql-jdbc

Hello Oliver,

Thanks for the prompt reply. Unfortunately I've got no access to  
Statement.setFetchSize() from within WebObjects. Is there any other  
way to solve this?

Kind regards,

Jan Willem

On May 11, 2005, at 3:59 PM, Oliver Jowett wrote:

> Jan Willem Luiten wrote:
>
>
>> This seems to be caused by the jdbc adaptor reading the complete
>> resultset instead of using a scrollable cursor. Is there a way to   
>> solve
>> this, eg by setting the fetchsize in some way?
>>
>
> Yes: Statement.setFetchSize(). Currently it only takes effect with
> autocommit off and TYPE_FORWARD_ONLY resultsets.
>
> -O
>
>




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: PostgreSQL, WebObjects and fetchSize
@ 2005-05-11 14:27  Oliver Jowett <oliver@opencloud.com>
  parent: Jan Willem Luiten <jwl@secondmove.com>
  0 siblings, 2 replies; 8+ messages in thread

From: Oliver Jowett @ 2005-05-11 14:27 UTC (permalink / raw)
  To: Jan Willem Luiten <jwl@secondmove.com>; +Cc: pgsql-jdbc

Jan Willem Luiten wrote:

> Thanks for the prompt reply. Unfortunately I've got no access to 
> Statement.setFetchSize() from within WebObjects. Is there any other  way
> to solve this?

This is up to WebObjects to support -- it's a standard JDBC mechanism.
The driver doesn't give you another way to set it.

-O



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: PostgreSQL, WebObjects and fetchSize
@ 2005-05-11 14:39  Jan Willem Luiten <jwl@secondmove.com>
  parent: Oliver Jowett <oliver@opencloud.com>
  1 sibling, 1 reply; 8+ messages in thread

From: Jan Willem Luiten @ 2005-05-11 14:39 UTC (permalink / raw)
  To: pgsql-jdbc

Hello again,

When using Openbase in the exact same setup, the out-of-memory error  
does not occur and the the results are batched properly. So somehow  
the jdbc adaptor for Openbase is able to perform this "trick" in  
combination with WebObjects, while the PostgreSQL jdbc adaptor is  
not. Yet, WO has no special provisions to work in conjunction with  
Openbase.

Besides that, on the TODO list it says under "Performance":

     Allow scrollable ResultSets to not fetch all results in one batch.

Could this have to do with the problem I encountered?

kind regards,

Jan Willem.

On May 11, 2005, at 4:27 PM, Oliver Jowett wrote:

> Jan Willem Luiten wrote:
>
>
>> Thanks for the prompt reply. Unfortunately I've got no access to
>> Statement.setFetchSize() from within WebObjects. Is there any  
>> other  way
>> to solve this?
>>
>
> This is up to WebObjects to support -- it's a standard JDBC mechanism.
> The driver doesn't give you another way to set it.
>
> -O
>
>




^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: PostgreSQL, WebObjects and fetchSize
@ 2005-05-11 21:49  Oliver Jowett <oliver@opencloud.com>
  parent: Jan Willem Luiten <jwl@secondmove.com>
  0 siblings, 0 replies; 8+ messages in thread

From: Oliver Jowett @ 2005-05-11 21:49 UTC (permalink / raw)
  To: Jan Willem Luiten <jwl@secondmove.com>; +Cc: pgsql-jdbc

Jan Willem Luiten wrote:

> Besides that, on the TODO list it says under "Performance":
> 
>     Allow scrollable ResultSets to not fetch all results in one batch.
> 
> Could this have to do with the problem I encountered?

Possibly. As I originally said:

> Yes: Statement.setFetchSize(). Currently it only takes effect with
> autocommit off and TYPE_FORWARD_ONLY resultsets.

Perhaps WebObjects is using resultsets of a different type, or has
autocommit on. I couldn't say without seeing the code in question.

-O



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: PostgreSQL, WebObjects and fetchSize
@ 2005-05-11 22:04  Kris Jurka <books@ejurka.com>
  parent: Oliver Jowett <oliver@opencloud.com>
  1 sibling, 1 reply; 8+ messages in thread

From: Kris Jurka @ 2005-05-11 22:04 UTC (permalink / raw)
  To: Oliver Jowett <oliver@opencloud.com>; +Cc: Jan Willem Luiten <jwl@secondmove.com>; pgsql-jdbc



On Thu, 12 May 2005, Oliver Jowett wrote:

> Jan Willem Luiten wrote:
> 
> > Thanks for the prompt reply. Unfortunately I've got no access to 
> > Statement.setFetchSize() from within WebObjects. Is there any other  way
> > to solve this?
> 
> This is up to WebObjects to support -- it's a standard JDBC mechanism.
> The driver doesn't give you another way to set it.
> 

Well defaulting it to a nonzero value is a reasonable thing to do, we have
just chosen not to for the pg driver because of possible performance
problems specific to pg.  We could consider exposing it via a URL
parameter.

Kris Jurka



^ permalink  raw  reply  [nested|flat] 8+ messages in thread

* Re: PostgreSQL, WebObjects and fetchSize
@ 2005-05-12 09:21  David Teran <david.teran@cluster9.com>
  parent: Kris Jurka <books@ejurka.com>
  0 siblings, 0 replies; 8+ messages in thread

From: David Teran @ 2005-05-12 09:21 UTC (permalink / raw)
  To: Kris Jurka <books@ejurka.com>; +Cc: pgsql-jdbc; Jan Willem Luiten <jwl@secondmove.com>; Oliver Jowett <oliver@opencloud.com>

Hi,

>>> Thanks for the prompt reply. Unfortunately I've got no access to
>>> Statement.setFetchSize() from within WebObjects. Is there any other  
>>> way
>>> to solve this?
>>
>> This is up to WebObjects to support -- it's a standard JDBC mechanism.
>> The driver doesn't give you another way to set it.
>>
>
> Well defaulting it to a nonzero value is a reasonable thing to do, we 
> have
> just chosen not to for the pg driver because of possible performance
> problems specific to pg.  We could consider exposing it via a URL
> parameter.
>

That would be fine. What default value do you suggest? Project Wonder 
for WebObjects has a postgres plugin for WebObjects and i already added 
some features to the plugin so in the  meantime i would add this 
reasonable default value to the plugin so people using the plugin and 
postgres and webobjects are happy. All i need to know is a good default 
value.

And WebObjects is not using autocommit=true for Postgres, it respects 
the transaction capability from postgres and uses normal transactions.

regards, David




^ permalink  raw  reply  [nested|flat] 8+ messages in thread


end of thread, other threads:[~2005-05-12 09:21 UTC | newest]

Thread overview: 8+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-05-11 13:47 PostgreSQL, WebObjects and fetchSize Jan Willem Luiten <jwl@secondmove.com>
2005-05-11 13:59 ` Oliver Jowett <oliver@opencloud.com>
2005-05-11 14:17   ` Jan Willem Luiten <jwl@secondmove.com>
2005-05-11 14:27     ` Oliver Jowett <oliver@opencloud.com>
2005-05-11 14:39       ` Jan Willem Luiten <jwl@secondmove.com>
2005-05-11 21:49         ` Oliver Jowett <oliver@opencloud.com>
2005-05-11 22:04       ` Kris Jurka <books@ejurka.com>
2005-05-12 09:21         ` David Teran <david.teran@cluster9.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox