Обсуждение: Server Side Cursors.

Поиск
Список
Период
Сортировка

Server Side Cursors.

От
"Ryan C. Bonham"
Дата:
Hi,

I just ran across an interesting problem with my Visual Basic 6.0sp5 Program. I am using version 7.1.0.8 of the ODBC
driver.I have a DBGrid, it is actually The "True DBGrid" from Component One, on a Form. It is connected to a table,
usinga bound dataenvironment, which contains 5110 records. As long as I use server side cursors, the grid will only
display8 records. When I change to Client Side Cursors it displays all 5110 records.. I have tried changing lock types,
etc..and have not got server side to work at all. The ODBC Driver logs show that it is opening the correct table with
all5110 records.. I have not turned on Server Side logging, but I can if that will help figure this out.  

Is this in anyway related to my previous post from 10/09/2001. "[ODBC] ODBC ServerSide Cursors Error"? Was that fix
includedin the new 7.1.0.8 driver?  

Thanks in advance, if you need more information just let me know.

Ryan C. Bonham

Re: Server Side Cursors.

От
"Andrea Aime"
Дата:
As far as I knok server side cursor are not supported. If you
have to fetch a high number of row from the database use
client side cursor and enable "declare/fetch" on the driver
options for decent performance (althought you won't be anymore
able to use bidirectional cursors...)
Hope this helps
Best regards
Andrea Aime

"Ryan C. Bonham" wrote:
>
> Hi,
>
> I just ran across an interesting problem with my Visual Basic 6.0sp5 Program. I am using version 7.1.0.8 of the ODBC
driver.I have a DBGrid, it is actually The "True DBGrid" from Component One, on a Form. It is connected to a table,
usinga bound dataenvironment, which contains 5110 records. As long as I use server side cursors, the grid will only
display8 records. When I change to Client Side Cursors it displays all 5110 records.. I have tried changing lock types,
etc..and have not got server side to work at all. The ODBC Driver logs show that it is opening the correct table with
all5110 records.. I have not turned on Server Side logging, but I can if that will help figure this out. 
>
> Is this in anyway related to my previous post from 10/09/2001. "[ODBC] ODBC ServerSide Cursors Error"? Was that fix
includedin the new 7.1.0.8 driver? 
>
> Thanks in advance, if you need more information just let me know.
>
> Ryan C. Bonham
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

Re: Server Side Cursors.

От
Hiroshi Inoue
Дата:
"Ryan C. Bonham" wrote:
>
> Hi,
>
> I just ran across an interesting problem with my Visual Basic 6.0sp5
> Program. I am using version 7.1.0.8 of the ODBC driver. I have a
> DBGrid, it is actually The "True DBGrid" from Component One, on a
> Form. It is connected to a table, using a bound dataenvironment,
> which contains 5110 records. As long as I use server side cursors,
> the grid will only display 8 records. When I change to Client Side
> Cursors it displays all 5110 records.. I have tried changing lock
> types, etc.. and have not got server side to work at all. The ODBC
> Driver logs show that it is opening the correct table with all 5110
> records.. I have not turned on Server Side logging, but I can if
>  that will help figure this out.

What cursor type are you using ?

>
> Is this in anyway related to my previous post from 10/09/2001.
> "[ODBC] ODBC ServerSide Cursors Error"?

Not sure.

> Was that fix included in the new 7.1.0.8 driver?

Yes. The bug was not limited to server side cursors.

regards,
Hiroshi Inoue

Re: Server Side Cursors.

От
"Ryan C. Bonham"
Дата:
Hiroshi,

Here is some more information..

> What cursor type are you using ?

Working setup is:
Client Side Cursors Location, Static cursor type, and  Optimistic Locking.

The Following setups return only 8 records out of 5110:
Server Side Cursors Location, Static cursor type, and  Optimistic Locking.
Server Side Cursors Location, Keyset cursor type, and  Optimistic Locking.
Server Side Cursors Location, Static cursor type, and  Pessimistic Locking.
Server Side Cursors Location, Keyset cursor type, and  Pessimistic Locking.
Server Side Cursors Location, Static cursor type, and  ReadOnly Locking.

The following return 0 records:
Server Side Cursors Location, Dynamic cursor type, and  Optimistic Locking.
Server Side Cursors Location, forward-only cursor type, and  ReadOnly Locking.
Server Side Cursors Location, Dynamic cursor type, and  Pessimistic Locking.
Server Side Cursors Location, Dynamic cursor type, and  ReadOnly Locking.

The Select command the dataenvironment is using is;
select * from bloods where date is not null order by date desc

Here is the table structure:
CREATE TABLE "bloods" (
   "date" date,
   "animal" varchar(10),
   "p" text,
   "s" char(15),
   "glu" float8,
   "bun" text,
   "crea" float8,
   "tp" float8,
   "alb" float8,
   "tbil" float8,
   "alp" float8,
   "alt" float8,
   "ast" float8,
   "chol" text,
   "ca" float8,
   "phos" float8,
   "na" float8,
   "k" float8,
   "cl" float8,
   "agratio" text,
   "buncreatinineratio" float8,
   "globulin" text,
   "magnesium" text,
   "hgb" float8,
   "htc" float8,
   "wbc" float8,
   "rbc" float8,
   "mcv" float8,
   "mch" float8,
   "mchc" float8,
   "plt" float8,
   "plymph" text,
   "plymphpercent" text,
   "band" text,
   "bandpercent" text,
   "lymph" text,
   "lymphpercent" text,
   "mono" text,
   "monopercent" text,
   "eos" text,
   "eospercent" text,
   "baso" text,
   "basopercent" text
);
CREATE  INDEX "date_bloods_key" ON "bloods" ("date");
CREATE  INDEX "animal_bloods_key" ON "bloods" ("animal");


Thanks again.

Ryan


Re: Server Side Cursors.

От
Hiroshi Inoue
Дата:
"Ryan C. Bonham" wrote:
>
> Hiroshi,
>
> Here is some more information..
>
> > What cursor type are you using ?
>
> Working setup is:
> Client Side Cursors Location, Static cursor type, and  Optimistic Locking.
>
> The Following setups return only 8 records out of 5110:
> Server Side Cursors Location, Static cursor type, and  Optimistic Locking.
> Server Side Cursors Location, Keyset cursor type, and  Optimistic Locking.
> Server Side Cursors Location, Static cursor type, and  Pessimistic Locking.
> Server Side Cursors Location, Keyset cursor type, and  Pessimistic Locking.
> Server Side Cursors Location, Static cursor type, and  ReadOnly Locking.
>
> The following return 0 records:
> Server Side Cursors Location, Dynamic cursor type, and  Optimistic Locking.
> Server Side Cursors Location, forward-only cursor type, and  ReadOnly Locking.
> Server Side Cursors Location, Dynamic cursor type, and  Pessimistic Locking.
> Server Side Cursors Location, Dynamic cursor type, and  ReadOnly Locking.
>
> The Select command the dataenvironment is using is;
> select * from bloods where date is not null order by date desc

Here I can see that Dynamic cursors return no row but
Keyset/Static cursors seem to return proper results for
some simple test cases.
Anyway the current psqlodbc driver itself supports only
ForwardOnly/Static cursors with ReadOnly locking. Oh,
they don't return proper results either. Hmm strange..

regards,
Hiroshi Inoue