Re: Record locking issue using ODBC from .NET

Поиск
Список
Период
Сортировка
От Hiroshi Inoue
Тема Re: Record locking issue using ODBC from .NET
Дата
Msg-id 44F4D02F.3080406@tpf.co.jp
обсуждение исходный текст
Ответ на Record locking issue using ODBC from .NET  (anomatos@freemail.gr)
Список pgsql-odbc
Hi Antonis,
Which version of driver are you using ?

regards,
Hiroshi Inoue

anomatos@freemail.gr wrote:
> I want to have exclusive read access to a table row, so that if a client has access to that row, any other client
shouldeither wait or get an error of the type "could not obtain lock on row in relation 'customers'", depending on the
semanticsused in the query string(nowait) 
>
> Both clients execute:
>
> ...
> OdbcTransaction ^ transaction = connection->BeginTransaction();
> String ^ query = "select * from customers where id = 3 for update nowait";
> OdbcCommand ^ cmd = (gcnew OdbcCommand(query, connection, transaction));
> reader = cmd->ExecuteReader();
> ...
>
> After the first client locks the record and before he ends the transaction, the second tries to acquire the lock. As
expectedan exception is raised, BUT: 
>
> One would expect that this exception is of type OdbcException explaining that "the lock cannot be aquired". Instead
ofthis I get a System::InvalidOperationException which disables my connection for some reason. However the above
exceptionhosts an inner exception of the desired type(OdbcException).  
>
> Does anybody have any idea why I get this type of behaviour, why is my connection closed?
>
> Thanks a lot in advance,
> Antonis

В списке pgsql-odbc по дате отправления:

Предыдущее
От:
Дата:
Сообщение: [ psqlodbc-Bugs-1000720 ] SQLGetInfo SQL_DATABASE_NAME no info
Следующее
От: Hiroshi Inoue
Дата:
Сообщение: Re: [COMMITTERS] psqlodbc - psqlodbc: Fixed dllname of win32