# transaction time out or can't start occasional

**URL:** <https://forums.percona.com/t/transaction-time-out-or-cant-start-occasional/1201>\
**Category:** Other MySQL® Questions\
**Created:** [July 3, 2009, 8:48pm UTC](https://forums.percona.com/t/transaction-time-out-or-cant-start-occasional/1201 "2009-07-03T20:48:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wenew](https://avatars.discourse-cdn.com/v4/letter/w/58956e/32.png) [@wenew](https://forums.percona.com/u/wenew)\
**Post date:** [July 3, 2009, 8:48pm UTC](https://forums.percona.com/t/transaction-time-out-or-cant-start-occasional/1201/1 "2009-07-03T20:48:42Z")

</div>

declare \_nextPid int;  
declare \_nextName varchar(20);  
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;   
select ifnull(next\_prop,0) from prop where pid=ipid into \_nextPid;  
select pname from prop where pid=\_nextPid into \_nextName;  
if (\_nextPid\>0) then  
update world\_animal set pid=\_nextPid,wname=\_nextName,last\_growup=now() where aid=iaid;  
end if;

world\_animal records:73959

aid is the primary key,i suppose with read committed should donnot lock whole table,

occasional,call pa\_growup(82342,332) will get message:Lock wait timeout exceeded; try restarting transaction  
but call pa\_growup(82340,331) is work,

what wrong with my store procedure?

---

<div class="post-metadata">

**Author:** ![wenew](https://avatars.discourse-cdn.com/v4/letter/w/58956e/32.png) [@wenew](https://forums.percona.com/u/wenew)\
**Post date:** [July 3, 2009, 9:01pm UTC](https://forums.percona.com/t/transaction-time-out-or-cant-start-occasional/1201/2 "2009-07-03T21:01:18Z")

</div>

CPU: Intel(R) Xeon™ CPU 3.00GHz (2992.52-MHz 686-class CPU)  
avail memory = 2091335680 (1994 MB)  
my.cnf:  
[client]  
#password = [your\_password]  
port = 3306  
socket = /tmp/mysql.sock  
default-character-set=utf8

[mysqld]  
default-character-set=utf8  
init\_connect=‘SET NAMES utf8’

# generic configuration options

port = 3306  
socket = /tmp/mysql.sock  
back\_log = 50

max\_connections = 2500  
max\_connect\_errors = 5  
table\_cache = 2048

max\_allowed\_packet = 16M

# The size of the cache to hold the SQL statements for the binary log

binlog\_cache\_size = 1M  
max\_heap\_table\_size = 32M  
sort\_buffer\_size = 8M  
join\_buffer\_size = 8M  
thread\_cache\_size = 8  
thread\_concurrency = 4

query\_cache\_size = 62M

query\_cache\_limit = 2M

ft\_min\_word\_len = 4

default\_table\_type = MYISAM

thread\_stack = 192K  
transaction\_isolation = READ-COMMITTED  
tmp\_table\_size = 32M

log\_slow\_queries  
long\_query\_time = 2

log\_long\_format

key\_buffer\_size = 32M

read\_buffer\_size = 2M

read\_rnd\_buffer\_size = 16M  
bulk\_insert\_buffer\_size = 64M

myisam\_sort\_buffer\_size = 128M

myisam\_max\_sort\_file\_size = 1G

myisam\_max\_extra\_sort\_file\_size = 1G

myisam\_repair\_threads = 1

myisam\_recover

skip-federated

skip-bdb

innodb\_additional\_mem\_pool\_size = 16M

innodb\_buffer\_pool\_size = 1180M  
innodb\_data\_file\_path = ibdata1:10M:autoextend

innodb\_file\_io\_threads = 4

innodb\_thread\_concurrency = 0

innodb\_flush\_log\_at\_trx\_commit = 1

innodb\_log\_buffer\_size = 8M

innodb\_log\_file\_size = 256M  
innodb\_log\_files\_in\_group = 3

innodb\_max\_dirty\_pages\_pct = 90  
innodb\_lock\_wait\_timeout = 60  
innodb\_locks\_unsafe\_for\_binlog=1  
[mysqldump]

# Do not buffer the whole result set in memory before writing it to

# file. Required for dumping very large tables

quick

max\_allowed\_packet = 16M

[mysql]  
no-auto-rehash  
[isamchk]  
key\_buffer = 256M  
sort\_buffer\_size = 64M  
read\_buffer = 4M  
write\_buffer = 4M

[myisamchk]  
key\_buffer = 256M  
sort\_buffer\_size = 64M  
read\_buffer = 4M  
Write\_buffer = 4M  
[mysqlhotcopy]  
interactive-timeout

[mysqld\_safe]  
open-files-limit = 8192
