Re: deadlocks when fetching

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: David Gugick (davidg-nospam_at_imceda.com)
Date: 02/28/05


Date: Mon, 28 Feb 2005 12:18:33 -0500

Erik Knudsen wrote:
> Andrew J. Kelly wrote:
>
>> It sounds like you are using a server side cursor. Have you tried
>> using a client side cursor instead?
>
> We basically use (ODBC):
> ---------------------
> 1. SQLAllocStmt()
> 2. SQLExecDirect()
> 3. SQLFetch() (repetedly)
> 4. SQLFreeStmt()
> ---------------------
>
> We don't explicitly use cursors, and we don't want to because some of
> our supported DBMS's don't support it.
>
> I'd like to force the deadlock to happen at SQLExecDirect() or not at
> all. I guess that would involve setting some stricter (not as
> optimistic) locking policy or something. Any ideas?
>
>
> Regards,
> Erik Knudsen

Not sure if this is related, but I believe SQLAllocStmt() has been
replaced with SQLAllocHandle(). In addition SQLFreeStmt() is not
recommended in ODBC 3.0 and later (replaced with SQLFreeHandle I think).

But as Andrew mentioned, check your cursor type. probably fastest to use
a forward-only, read-only, firehose cursor with ODBC. These types of
"cursors" are not cursors in the strictest sense. They are analogous to
SQL Server generating a result set (as it normally does) and pulling
that information into the application using ODBC.

-- 
David Gugick
Imceda Software
www.imceda.com 


Relevant Pages

  • Re: Setting bind variables or defines from applications?
    ... Reopening cursors? ... we use ODBC (and running ODBC in ... Didn't hear of bind variables. ... returning a REF cursor? ...
    (comp.databases.oracle.misc)
  • Re: Multiple-step OLE DB operation generated errors.
    ... If you use an alternate database API (such as ADO or ODBC) rather than ... What is in fact happening is that the database server is, in some cases, ... downgrading or changing the cursor type from what was requested to something ... In the case of requesting a dynamic cursor, ...
    (microsoft.public.data.oledb)
  • Re: date
    ... How to create a cursor object? ... I dont have any VFP database. ... using connection string cnnSinaiRes (ODBC) as follows. ...
    (microsoft.public.fox.vfp.forms)
  • Re: General field?
    ... ODBC automatically convert a Memo field of any type to General. ... >>>I am using a memo field in a VFP8 dbf to hold a bmp file. ... >>> the resulting cursor is a 'General' data type. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: VB connection to SQL server
    ... > the client machine begins to lose its relevance and accuracy as soon as it ... > aware that the data is probably out of date, a client sided cursor might ... > design minimises the possibility that records will have changed in the ... >> The Database server is in the office, and people use the Vb program from ...
    (microsoft.public.vb.database)