db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Pendleton <bpendle...@amberpoint.com>
Subject Re: anybody know why the derby alway appear "requesting a lock"
Date Tue, 11 Sep 2007 14:51:21 GMT
> locks or deadlocks around the runtime. is it any easy way to avoid those 
> locks.  

This is a fairly complex subject. Here is a good place to start:
http://db.apache.org/derby/docs/10.2/devguide/cdevconcepts30291.html

Some of the tools under your control are:
  - use smaller transactions
  - ensure that tables have the right indexes
  - use the proper isolation level
  - update tables in a consistent order within transactions
  - use the FOR UPDATE clause when selecting rows in order
    to update them later in the same transaction
  - use the LOCK TABLE clause to force locking behavior

It can take a while, but careful application design will enable you
to have a high-performing, low-contention application.

thanks,

bryan


Mime
View raw message