I've found the answer to my problem in the bdb source...
>From bdb/include/db.src:
#define DB_LOCK_DEADLOCK (-30996)/* Deadlock. */
So the question is: how can a bunch of simultaneous connections that only
work on 1 table create a deadlock. And how can I write my code to avoid this
problem?
Is this an intrinsic problem with BDB, a problem with the way mysql handles
BDB, or a problem with my application code?
Additionaly, it would be nice if either the mysql engine returned a
string-ified version of the error code or if perror could handle these error
codes.
dpk
----- Original Message -----
From: "Dana Powers" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, September 15, 2001 1:52 PM
Subject: BDB table error
> Im getting this error from attempted inserts into a BDB table using
> mysql-3.23.42 ( same error but more often in 3.23.38 ):
>
> Could not insert new row into SESSION_DATA: Got error -30996 from table
> handler
>
> First - I have not been able to find what this error means in either the
> source code, online, or with tools like perror ( doesnt like negative
> numbers ). Does anyone have an idea what this is, or how to find out?
>
> Info on the situation:
> I've got X simultaneous connections inserting and updating rows, and this
> error consistently pops up if X > 16. If X = 32, more than half of the
> inserts are errors.
>
> Here is the table:
>
> CREATE TABLE SESSION_DATA (
> SESSION_ID int(10) unsigned NOT NULL auto_increment,
> SESSION_KEY varchar(32) default NULL,
> TS_ACCESS timestamp(14) NOT NULL,
> DATA text NOT NULL,
> PRIMARY KEY (SESSION_ID),
> UNIQUE KEY SESSION_DATA___SESSION_KEY (SESSION_KEY)
> ) TYPE=BerkeleyDB;
>
> Here are the sql statements used:
>
> ## Create a Session
> SET AUTOCOMMIT=0;
> INSERT INTO SESSION_DATA (SESSION_KEY,TS_ACCESS,DATA) VALUES
(NULL,NULL,'');
> UPDATE SESSION_DATA SET SESSION_KEY='32bytesofblah',TS_ACCESS=NULL,DATA=''
> WHERE SESSION_ID=###; ( ### was set to LAST_INSERT_ID() between sql
> statements )
> COMMIT;
> SET AUTOCOMMIT=1;
>
> ## Update a Session ( AUTOCOMMIT=1 )
> UPDATE SESSION_DATA SET SESSION_KEY='32bytes
ofblah',TS_ACCESS=NOW(),DATA='a
> load of text...' WHERE SESSION_ID=###;
>
> thanks for any info,
> dpk
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
> http://www.mysql.com/manual.php (the manual)
> http://lists.mysql.com/ (the list archive)
>
> To request this thread, e-mail [EMAIL PROTECTED]
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
>
>
>
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <mysql-unsubscribe-##L=##[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php