Re: SELECT ... FOR UPDATE and ResultSet

From: Barry Lind <blind(at)xythos(dot)com>
To: Jeffrey Tenny <jeffrey(dot)tenny(at)comcast(dot)net>
Cc: postgres jdbc <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: SELECT ... FOR UPDATE and ResultSet
Date: 2004-01-05 20:11:47
Message-ID: 3FF9C503.90606@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)tenny(at)comcast(dot)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
>

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message George Lessmann 2004-01-05 21:01:16 Re: odd jdbc driver synchronization issue
Previous Message Peter Eisentraut 2004-01-05 17:49:37 Re: PL/Java issues