Re: [bdbxml] General questions regarding transactions et al

George Feinberg <[email protected]> Thu, 22 Sep 2005 17:49:15 -0400
Newsgroups gmane.comp.db.dbxml.general
Message-ID <[email protected]>
The fact that you are getting DB_LOCK_NOTGRANTED
implies that you've set some configuration asking
for either a lock timeout or set DB_LOCK_NOWAIT.

What configuration options are you using for your
Environment?

Do you really need to be using transactions in the first place?
If you don't need them, you can simplify things.

The error, DB_LOCK_NOTGRANTED will occur when
the system would otherwise deadlock.  This means
that when you perform your updateDocument() call,
some thread (perhaps the current one) is holding
locks that are required for the update to happen.

A possible cause is not committing a transaction, or
mixing (by accident) transactional and non-transactional
operations.

Regards,

George


> I'm still trying to get my app running, but the DB_LOCK_NOTGRANTED- 
> error
> remains. Here's what the console's up to when I start the program:
>
> Updating documents
> Found 1 matching the expression   <--check, if file's present
> Updating document:
> Updating with new document        <--if so, update the document in  
> the container
>
> ---ENVIRONMENT DETAILS------     <-- some environment & transaction  
> stuff
> max lockers: 100000
> deadlock detection value: 0
> reg size: 98304
> stats (last) id: 964
> curmaxid id: 2147483647
> ---TRANSACTION DETAILS------
> transaction commits: 13
> max transactions (getMaxTxns()): 20
> last transaction id: -2147483634
> no. of aborted transactions: 0
> no. of active transactions: 1
> reg size (getRegSize()): 16384
> max active transactions(getMaNactive()): 2
>
> Error performing document update against mainDataStorage.dbxml
>    Message: Error: Db::del: DB_LOCK_NOTGRANTED: Lock not granted
> Exception in thread "main" com.sleepycat.dbxml.XmlException: Error:  
> Db::del:
> DB_LOCK_NOTGRANTED: Lock not granted, errcode = DATABASE_ERROR
>     at  
> com.sleepycat.dbxml.dbxml_javaJNI.XmlContainer_updateDocument__SWIG_1( 
> Native
> Method)
>     at com.sleepycat.dbxml.XmlContainer.updateDocument 
> (XmlContainer.java:361)
>     at ws.updateFile.doUpdateDocument(updateFile.java:109)
>     at ws.updateFile.updateDocument(updateFile.java:247)
>     at ws.updateFile.main(updateFile.java:275)
>
> Are there some general issues I should be aware of? I really don't  
> get it. Does
> "max transactions" really have anything to do with the transactions  
> committed?
> If so, why should the actual stat be a problem? I've used to work  
> with sql data
> bases so this whole problem's just confusing me, stabbing around in  
> the darkness
> of transactional void. What would be the best approach to solve the  
> problem? Any
> clever way of debugging faulty (berkeley db xml) database actions?
>
> Thnx in advance,
>
> M.B.



------------------------------------------
To remove yourself from this list, send an
email to [email protected]