db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Katherine Marsden <kmarsdende...@sbcglobal.net>
Subject Re: Behavior of SELECT with WITH UR and locking
Date Mon, 12 Aug 2013 19:44:50 GMT
On 8/12/2013 12:19 PM, jefffro wrote:
> Hello, I have the following situation ...
>
> - in the background an application is loading data into a number of
> normalized tables using batches of sql statements.  the net effect of this
> process is that one batch/transaction may be relatively long running.
>
> - at the same time, a read application is querying the database using a view
> (of some of the same tables as is being used by the batch sql) but it is
> alway using the WITH UR option on the view ... e.g. select a, b from
> schema.view where a in (1,2,3) WITH UR;
>
> Problem: At times, the SELECT statement is getting the error that says it is
> the loser in acquiring a LOCK.
> Question: Why would a SELECT ... WITH UR statement (which will do dirty
> reads trying to get a lock)?  Does Derby have situations where it ignores
> the WITH UR expression on selects? ... or is the  error message incorrect (I
> know I should have the error message in this post but not available to me at
> this moment).

I don't think there is a situation where it should ignore the UR. The 
only reason I can think of that you might get a lock timeout is if the 
table is actually created by the long running transaction.

>
> Thanks, Jeff
>
>
>
> --
> View this message in context: http://apache-database.10148.n7.nabble.com/Behavior-of-SELECT-with-WITH-UR-and-locking-tp133134.html
> Sent from the Apache Derby Users mailing list archive at Nabble.com.
>


Mime
View raw message