Hi Mike, 1. It has already been rolled back, so do a start transaction again. 2. - 3. It depends, 3 to 5 times would be reasonable. Before resubmitting the transaction wait some time (let's say half a second) to let the conflicting transaction finish.
When you keep getting deadlocks, try switching to InnoDB (row locks in stead of page locks) and take another look at the tranactions themselve like the sequence of insert/delete/update/select. Hope this helps. Peter Sap. ----- Original Message ----- From: "Mike Gollub" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, November 21, 2003 12:38 AM Subject: Re: Transaction newbie question > OK, I don't seem to be getting a response. Let me try to simplify: > > I'm running a PHP application with MySQL. > I'm in a transaction involving only BDB tables. Actually the whole database has nothing but BDB > tables. > I attempt a query which fails with error number 1213. The full text message is something like: > Can't get lock because of a deadlock. > > My questions: > 1. When the query fails am I still inside the transaction, or has it already been rolled back ? > 2. If the transaction has not been rolled back, how many times should I re-try the query before > giving up and re-starting the transaction ? > 3. If the transaction has been rolled back, what is a reasonable number of times to re-start the > transaction ? > > - Mike. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]