Skip site navigation (1) Skip section navigation (2)

asynchronous support

From: Radhesh Krishnan K <radheshkrishnank(at)gmail(dot)com>
To: pgsql-odbc(at)postgresql(dot)org
Subject: asynchronous support
Date: 2012-03-06 11:04:19
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-odbc

I  wanted to lock a table from one application and insert some data. And my
requirement is, if that table is already locked by anyother process then I
need to try to lock after a specific amount of time.

I am using unixODBC driver in centOS machine and my database is postgresql.
I did a research on how to execute a sql asynchronously using odbc api. I
found SQLSetStmtAttr api can be used to execute the sql statement
asynchronously. But its not working.

This is how I wrote the code

// above statement returned 0 which means success

 if((ret = SQLExecDirect(stmt1,"lock table test",SQL_NTS)) ==
     ret = SQLCancel(stmt);

But process is getting hang on SQLExecDirect api, as that table "test"
is already locked by another process. (Hang in the sense, waiting for
all other processes to release the lock)

Why is it so ? Is that because my unixODBC driver does not support
asynchronous execution. if its so why SQLSetStmtAttr is returning
success ?

Any help is greatly appreciated. Thanks in advance.


Radhesh Krishnan K.


pgsql-odbc by date

Next:From: Radhesh Krishnan KDate: 2012-03-06 11:46:35
Subject: Re: asynchronous support
Previous:From: marianDate: 2012-03-04 07:21:18
Subject: hang at SQLAllocStmt

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group