db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kasper, Kay" <kay.kas...@ckc.de>
Subject AW: locking problem when selecting data
Date Mon, 11 Jun 2007 08:39:14 GMT
Hi Stanley,

over the weekend i produced a test case (see the attachement). During my
tests I found out, that the not executed commit/rollback of the update
statement seems to be a solution for my special situation. An other solution
seems to be to change the lock level to read uncommitted for the selection.

In my opinion these solutions are only workarounds suitable for my
situation. The central question is, why are there any locks held for nothing
selected?

Kay



-----Urspr√ľngliche Nachricht-----
Von: Stanley Bradbury [mailto:Stan.Bradbury@gmail.com] 
Gesendet: Donnerstag, 7. Juni 2007 17:16
An: Derby Discussion
Betreff: Re: locking problem when selecting data

Kasper, Kay wrote:
> Hi,
>
> i have a problem with the locking of a row. the situation:
>
> Derby (10.1.3.1 and 10.2.6.1) running as server with two separatly running
> client-applications (ij and own application).
>
> Within my application i create a row in the database and commit.
> With ij i change the row (only the one column for versioning, not primary
> key) in the database and commit.
> Within my application i try to update the row with the old version info,
the
> row is not found and updated. No commit/rollback yet.
> Within my application i try to read the row without version condition,
only
> by primary key and not for update.
>
> Then i get an SQLException (row could not be locked), saying, that not
lock
> could be set within the definied time.
>
> I ran my application in debug mode to do the ij task between my own
> statements.
>
> There was another posting at 04/18/2007 "commit then read immediately"
which
> sounds very simular.
>
> I'm not using any caching in my application.
>
> On other databases like Orcale and hqsl i don't have that problem. Whats
> wrong with the row locking? Why does a normal select try to set a lock?
>
> Thanks for your help.
>
> Kay
>
>
>
> --------------------------
> ckc ag
> Sitz:
> Industriestr. 10
> 38110 Braunschweig
>
> Telefon 05307 / 80 20 0
> Telefax 05307 / 80 20 444
> http://www.ckc.de
>
> Amtsgericht Braunschweig
> HRB 5405
>
> Vorstand:
> H.-G. Christian Krentel
> (Vorsitzender)
>
> Aufsichtsrat:
> Dr. Heinz-Werner Weinrich
> (Vorsitzender)
> Hans Bodenstein
> Dr. Rita Schulz
> --------------------------
>
>
>   
Hi -
I'd need a specific test case to tell what is going on.  Locking 
behavior is determined by the transaction isolation level, autocommit 
and the access method being used.  My guess is that adjusting the 
isolation level will give you the results you desire reagardless of 
access method.






--------------------------
ckc ag
Sitz:
Industriestr. 10
38110 Braunschweig

Telefon 05307 / 80 20 0
Telefax 05307 / 80 20 444
http://www.ckc.de

Amtsgericht Braunschweig
HRB 5405

Vorstand:
H.-G. Christian Krentel
(Vorsitzender)

Aufsichtsrat:
Dr. Heinz-Werner Weinrich
(Vorsitzender)
Hans Bodenstein
Dr. Rita Schulz
--------------------------



Mime
View raw message