# Mysql gem reporting deadlock

**URL:** <https://www.ruby-forum.com/t/mysql-gem-reporting-deadlock/112288>\
**Category:** Ruby\
**Created:** [August 17, 2007, 2:14am UTC](https://www.ruby-forum.com/t/mysql-gem-reporting-deadlock/112288 "2007-08-17T02:14:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chillexistence](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ee7513/32.png) [@chillexistence](https://www.ruby-forum.com/u/chillexistence)\
**Post date:** [August 17, 2007, 2:14am UTC](https://www.ruby-forum.com/t/mysql-gem-reporting-deadlock/112288/1 "2007-08-17T02:14:49Z")

</div>

I posted this message on the mysql forum:

[http://forums.mysql.com/read.php?97,167771,167771](http://forums.mysql.com/read.php?97,167771,167771)

and the ruby code in question uses the mysql-2.7 gem directly. Not  
using active record.

When the deadlock occurs it takes about 2 mins and times out with an  
error.

But if the run the same SQL in mysql console with two sessions, I get a  
deadlock error right away.

Is there a way to make the ruby mysql gem return the deadlock error  
without the 2 min wait?

Thanks.
