Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / Ingres Topics / July 2004

Tip: Looking for answers? Try searching our database.

E_DM9042_PAGE_DEADLOCK on record with a lot of concurrency

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Franky Leeuwerck - 23 Jul 2004 10:57 GMT
Hello,

We see frequently E_DM9042_PAGE_DEADLOCK errors on a hash table
(unique keys)  with 1 record.  The table is meant for holding an
incremental key for determining the key of another table.

The 1 record table is heavily accessed by a lot of sessions in a small
time.

What is a good approach to avoid these E_DM9042_PAGE_DEADLOCK errors,
as I understand some of the deadlocking sessions will be aborted.

We run Adv Ingres SP2 64bit release on HP-UX 11i with internal
(Ingres) threads.

Thanks in advance,
Franky Leeuwerck
Roy Hann - 24 Jul 2004 10:45 GMT
> Hello,
>
> We see frequently E_DM9042_PAGE_DEADLOCK errors on a hash table
> (unique keys)  with 1 record.  The table is meant for holding an
> incremental key for determining the key of another table.

The applications are selecting the new key value, then updating it to
increment the counter.  They need to do it the other way round; increment,
then read.

The deadlock occurs because two sessions have read the same key value, so
both are entitled to read-consistency, and then one of them attempted to
update the counter and got blocked.  Being blocked isn't a problem, but when
the other session then tried to do its update it got blocked too.  Neither
can proceed without violating read-consistency, and so they are deadlocked.

The text of a paper I presented at CA World '96 called "Key Points About
Surrogate Keys" is available from the Resources section of our web site at
www.rationalcommerce.com.  It talks about this problem and many others, and
how to deal with them.  (It also, incidentally, argues *very* strongly
against using sequential key values, and shows an alternative.)

> The 1 record table is heavily accessed by a lot of sessions in a small
> time.
>
> What is a good approach to avoid these E_DM9042_PAGE_DEADLOCK errors,
> as I understand some of the deadlocking sessions will be aborted.

Not quite.  In a deadlock one of the *transactions* is aborted.  The session
is still there so all it has to do is re-try the whole transaction from the
beginning (i.e. re-do every update since its last successful
commit/rollback).

Roy Hann (rhann at rationalcommerce dot com)
Rational Commerce Ltd.
www.rationalcommerce.com
"Ingres development, tuning, and training experts"
Franky Leeuwerck - 27 Jul 2004 07:57 GMT
Roy,
Thanks for the " update_first/read_then " comment. We use that
approach in database procedures that increment the key_value.

I'll go through your document.

Regards,
Franky
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.