db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Myrna van Lunteren <m.v.lunte...@gmail.com>
Subject Re: SQL State: 40XL1
Date Tue, 18 Mar 2014 09:16:05 GMT
Hi,

You might have a query that runs for a long time.
You might be able to speed it up by adding indexes, or you can adjust the
timeout properties.
Or you might have multiple connections that fight eachother.

Read the relevant section in the Derby Developer's Guide on Locking,
concurrency, and isolation which explains it better than I can:
http://db.apache.org/derby/docs/10.10/devguide/cdevconcepts30291.html

There are additional helpful wiki pages and sections in the reference
manual:
  http://wiki.apache.org/db-derby/LockDebugging
and 5.4 (currently) of the FAQs describes how you can look into the lock
timeouts: http://db.apache.org/derby/faq.html#debug_lock_timeout

You might need to set the following properties in a derby.properties file
to debug to see the queries (if you don't have one already, you'll need to
create it, place it wherever your derby.log file gets created. Remove it or
comment it out for production):
   # append to derby.log over multiple sessions.
   derby.infolog.append=true
   # print out all queries to derby.log
   derby.language.logStatementText=true
   # print out full text of all error messages, not just the most severe
   derby.stream.error.logSeverityLevel=0
   # print lock table information to derby.log on timeout and for deadlocks
   derby.infolock.appendderby.locks.monitor=true
   derby.locks.deadlockTrace=true

You can check on the meaning and default values of these properties in the
reference guide:
http://db.apache.org/derby/docs/10.10/ref/crefproper22250.html

In that same place you find information about the properties you can use to
adjust the default wait times:
- derby.locks.waitTimeout
http://db.apache.org/derby/docs/10.10/ref/rrefproper46141.html#rrefproper46141
- derby.locks.deadlockTimeout
http://db.apache.org/derby/docs/10.10/ref/rrefproper10607.html#rrefproper10607

Myrna


On Tue, Mar 18, 2014 at 1:06 AM, Bob M <rgmatthews@orcon.net.nz> wrote:

> Hi
>
> I connect to a derby dbase in my java program and get a message to say the
> connection is made
> Then, once in a while, I get the following...............
>
> --------SQL Exception-----------
> SQL State: 40XL1
> Error Code: 30000
> Message: A lock could not be obtained within the time requested
>
> Please can somebody interpret what the problem is ?
> Do I need to add further debugging code ?
> I do not understand 'the time requested' .... can I alter this?
>
> Bob M
>
>
>
> --
> View this message in context:
> http://apache-database.10148.n7.nabble.com/SQL-State-40XL1-tp138053.html
> Sent from the Apache Derby Users mailing list archive at Nabble.com.
>

Mime
View raw message