Re: Row Lock - Mailing list pgsql-jdbc

From Andreas Prohaska
Subject Re: Row Lock
Date
Msg-id A11D9B8C48C1D411AE0C000062A129947B1CAF@ganymed.allocation.net
Whole thread Raw
In response to Row Lock  ("Waldomiro" <wmiro@shx.com.br>)
Responses Re: Row Lock
List pgsql-jdbc
Even if this function would be implemented, your application would have
to keep the ResultSet/Transaction open while the data is presented to
the user in order to detect updates. So it would still be bad design.

After all I think that it is not possible to implement this function
because the backend itself handles updates/transactions in a way that
does not allow this kind of check (at least: doesn't directly support
it).

The easiest way to come around this sort of problem is to use an
optimistic control column (like an int) that is incremented
with every row update. This allows you to detect changes by other
users before making your own.

>
> Hello,
> I also have to do a similar program and I ended up implementing this
> exact scheme.
> But I had to use hashes of the record to check if it was
> changed because
> it seems like the proper function, expressely designed for that is not
> implementend: ResultSet.rowUpdated().
>
> Do you know if there are plans of supporting it?
>
> It would be a great boost for JDBC applications.
>

pgsql-jdbc by date:

Previous
From: Alessandro Polverini
Date:
Subject: Re: Row Lock
Next
From: Alessandro Polverini
Date:
Subject: Re: Row Lock