[unixODBC-support] unixODBC-support Digest, Vol 67, Issue 12

Daniil A Megrabjan danil.megrabjan at gmail.com
Mon Apr 19 12:33:47 BST 2010


2010/4/19  <unixodbc-support-request at mailman.unixodbc.org>:
> Message: 3
> Date: Mon, 19 Apr 2010 11:06:12 +0100
> From: Nick Gorham <nick.gorham at easysoft.com>
> Subject: Re: [unixODBC-support] Correct closing the cursor
> To: Support for the unixODBC project
>        <unixodbc-support at mailman.unixodbc.org>
> Message-ID: <4BCC2B14.8070500 at easysoft.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Daniil A Megrabjan wrote:
>> Hello
>>
>> I'm using Sybase Anywhere 9 driver with unixODBC. I do a simple query
>> SELECT * FROM TABLE1, and then I close the cursor. The problem is that
>> after closing the shared lock remains, that is why I can not write
>> anything in this table. How I must close cursors correctly, any
>> ideas?!
>>
>> Now.
>>
>> Open:
>> ====
>> SQLAllocHandle(SQL_HANDLE_STMT, Connection->DbcHandle, &Stmt);
>> SQLSetStmtAttr(Stmt, SQL_ATTR_CURSOR_SENSITIVITY, (void *) SQL_INSENSITIVE, 0);
>> SQLSetStmtAttr(Stmt, SQL_ATTR_CONCURRENCY, (void *) SQL_CONCUR_READ_ONLY, 0);
>> SQLSetStmtAttr(Stmt, SQL_ATTR_USE_BOOKMARKS, (void *) SQL_UB_VARIABLE, 0);
>> SQLSetStmtAttr(Stmt, SQL_CURSOR_TYPE, (void *) SQL_CURSOR_KEYSET_DRIVEN, 0);
>> SQLPrepare(Stmt, (unsigned char *) SQL, SQL_NTS);
>> SQLExecute(Stmt);
>>
>> Close:
>> ====
>> SQLCloseCursor(Stmt);
>> SQLFreeStmt(Stmt, SQL_UNBIND);
>> SQLFreeHandle(SQL_HANDLE_STMT, Stmt);
>> Stmt = SQL_NULL_HANDLE;
>>
>>
> Well, AFAIKS what you are doing should close the cursor and release any
> locks. I would guess some magic in the driver. Maybe try a
This is original ODBC driver from Sybase :\
>
> SQLFreeStmt(Stmt, SQL_CLOSE);
>
> instead of the SQLCloseCursor and see if thats any better.
No, it did not help :(

-- 
Daniil A Megrabjan | email danil.megrabjan at gmail.com | icq 4545450 |
skype danil.megrabjan


More information about the unixODBC-support mailing list