pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: anomatos@freemail.gr
To: pgsql-odbc@postgresql.org
Subject: Re: Record locking issue using ODBC from .NET
Date: Thu, 31 Aug 2006 15:53:15 +0300
Message-ID: <44f6dbbba743b5.02235290@freemail.gr> (raw)
References: <44f6d60abb3116.51244977@freemail.gr>


Please try the 8.2.0100 which would be released soon.
If you are in a hurry, please install the 8.2.0002 version at
http://pgfoundry.org/projects/psqlodbc/ .

regars,
Hiroshi Inoue

> anomatos@freemail.gr wrote:
> Hello there,
>
> I'm using version 8.01.02.00 of the PostgreSQL driver, any ideas?
>
>

> > 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 should either wait or get an
> > > error of the type "could not obtain lock on row in relation 'customers'",
> > > depending on the semantics used 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 expected an exception is raised,
> > > BUT:
> > >
> > > One would expect that this exception is of type OdbcException explaining that
> > > "the lock cannot be aquired". Instead of this I get a
> > > System::InvalidOperationException which disables my connection for some
> > > reason. However the above exception hosts 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






view thread (3+ messages)

Message-ID: <44f6dbbba743b5.02235290@freemail.gr>
Permalink:  ../44f6dbbba743b5.02235290@freemail.gr/
Also on:    postgresql.org/message-id/44f6dbbba743b5.02235290@freemail.gr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: anomatos@freemail.gr
  Subject: Re: Record locking issue using ODBC from .NET
  In-Reply-To: <44f6dbbba743b5.02235290@freemail.gr>
  References: <44f6d60abb3116.51244977@freemail.gr> <44f6dbbba743b5.02235290@freemail.gr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox