Re: SELECT ... FOR UPDATE and ResultSet - Mailing list pgsql-jdbc

From Barry Lind
Subject Re: SELECT ... FOR UPDATE and ResultSet
Date
Msg-id 3FF9C503.90606@xythos.com
Whole thread Raw
In response to Re: SELECT ... FOR UPDATE and ResultSet  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-jdbc
Jeff,

I don't know if you are trying to support multiple databases or not, but
this behavior does vary across databases.  In DB2 for example only the
current row your cursor is on is locked, Oracle will lock all rows that
satisfy the query (even if you never fetch them all).

--Barry

Tom Lane wrote:

> Jeffrey Tenny <jeffrey.tenny@comcast.net> writes:
>
>>Can I count on this behavior for PostgreSQL?  Or will it fail to lock
>>all rows if
>>I have a sufficiently large ResultSet and Connection.setFetchSize() does
>>it's magic?
>
>
> In the current implementation, the backend will only lock those rows
> actually returned to the client.  If setFetchSize() causes not all the
> rows to be fetched, you lose ...
>
>             regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: the planner will ignore your desire to choose an index scan if your
>       joining column's datatypes do not match
>


pgsql-jdbc by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] PL/Java issues
Next
From: "George Lessmann"
Date:
Subject: Re: odd jdbc driver synchronization issue