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

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:

There are additional helpful wiki pages and sections in the reference
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.
   # print out all queries to derby.log
   # print out full text of all error messages, not just the most severe
   # print lock table information to derby.log on timeout and for deadlocks

You can check on the meaning and default values of these properties in the
reference guide:

In that same place you find information about the properties you can use to
adjust the default wait times:
- derby.locks.waitTimeout
- derby.locks.deadlockTimeout


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.

View raw message