niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Databases » Berkeley DB
Deadlock in read-only operations
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
Author Message
bob.s.walters@gmail.com
*nix forums beginner


Joined: 23 Mar 2006
Posts: 3

PostPosted: Sun Jun 25, 2006 1:17 am    Post subject: Re: Deadlock in read-only operations Reply with quote

Hi Ron,

I think I have this figured out. The error we're getting is not
actually a deadlock, it was a lock not granted exception. We're using
the standard BDB product, java api. (The one which is based on JNI.)
The lock not granted exception appears to have been our fault.

One thing that threw us off for a bit was that we "assumed" that the
TransactionRunner would handle both deadlock exceptions and lock not
granted exceptions. So we mis-interpreted lock not granted exceptions
as indicating that a good deal of retry had happened, when in fact it
hadn't.

After clearing up some of the code, we now seem to be deadlock free.
Back to top
Ron
*nix forums Guru Wannabe


Joined: 01 Apr 2005
Posts: 157

PostPosted: Wed Jun 21, 2006 8:38 pm    Post subject: Re: Deadlock in read-only operations Reply with quote

Hi Bob,

bob.s.walters@gmail.com wrote:
Quote:
I wanted to ask if it is possible for threads using read-only cursor
operations to experience deadlocks in a transaction environment.

Deadlocks should not occur when you have ONLY read-only cursor

operations.

Can an application
Quote:
using transactional cursors, in a read-only manner still encounter
deadlocks?

This should not happen.

Are you sure you have turned off ALL update activity?

What version of Berkeley DB are you running with?

What OS?

Ron
Back to top
bob.s.walters@gmail.com
*nix forums beginner


Joined: 23 Mar 2006
Posts: 3

PostPosted: Tue Jun 20, 2006 4:09 am    Post subject: Deadlock in read-only operations Reply with quote

I wanted to ask if it is possible for threads using read-only cursor
operations to experience deadlocks in a transaction environment.

In the application I am working with, we have a large number of threads
doing stateless service requests. The threads create transactions, and
use the transactions to create cursors via the Java method
Database.openCursor(txn,null); It then ends up using that cursor to
find data by calling Cursor.getKeySearchRange( with a lock mode of
DB_READ_COMMITTED).

Right now the idea is to minimize the chance of deadlocks because we
have a high total # of thread reading the table. We initially had our
application updating some of the data being read, but got a high
frequence of deadlocks. We removed the updates.

One thing we are still seeing is something odd in the transactional
stats. We are still seeing the aborted transaction count go up, but to
my knowledge the only situation where we would do an abort is from the
TransactionRunner object, in the event that maximum retries is
surpassed (10). Otherwise, I can't explain the increase in aborts.
Does the statistics on transactions include commit and abort activity
not directly related to application transactions? Can an application
using transactional cursors, in a read-only manner still encounter
deadlocks?
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [3 Posts] View previous topic :: View next topic
The time now is Fri Nov 21, 2008 4:43 am | All times are GMT
navigation Forum index » Databases » Berkeley DB
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts ConfigParser: what read('non-existent-filename') returns ... Danil Dotsenko python 4 Thu Jul 20, 2006 5:50 pm
No new posts socket read modifies third parameter after the call: Very... jainarunk@gmail.com networking 1 Thu Jul 20, 2006 3:47 pm
No new posts ===Welcome to comp.lang.c++! Read this first. Shiva C++ 0 Wed Jul 19, 2006 4:29 pm
No new posts multiple InnoDB read-only server instances on same file s... pradhuman jhala MySQL 1 Tue Jul 18, 2006 11:48 pm
No new posts A new reader? Welcome to comp.os.linux.setup, read this f... FAQ (bi-weekly) Setup 0 Tue Jul 18, 2006 11:10 pm

Libros de historia | Loans | Actress | Unsecured Loans | Remortgages
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1496s ][ Queries: 20 (0.0775s) ][ GZIP on - Debug on ]