SQL "Lock wait timeout exceeded"

View: New views
4 Messages — Rating Filter:   Alert me  

SQL "Lock wait timeout exceeded"

by Jerry M :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm sure this exception I'm getting is related to my db configuration.  
But I don't have a clue where to start.  I'm running MySQL.  Can someone
explain what this error is really telling me?  What is happening with
MySQL, and what parameter(s) do I need to look at and possibly tweak on
MySQL to prevent these problems in the future?  The CPU is nowhere near
capacity.  So I don't believe this is simply a load problem.

javax.mail.MessagingException: Exception caught while storing mail
Container: ;
  nested exception is:
        java.sql.SQLException: Lock wait timeout exceeded; try
restarting transaction
        at
org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepository.java:764)
        at
org.apache.james.transport.mailets.ToMultiRepository.storeMail(ToMultiRepository.java:230)
        at
org.apache.james.transport.mailets.ToMultiRepository.service(ToMultiRepository.java:154)
        at
org.apache.james.transport.mailets.LocalDelivery.service(LocalDelivery.java:66)
        at
org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:424)
        at
org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:405)
        at
org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:309)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.sql.SQLException: Lock wait timeout exceeded; try
restarting transaction
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:3256)
        at
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1313)
        at
com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:874)
        at
org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:168)
        at
org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepository.java:752)



---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@...
For additional commands, e-mail: server-user-help@...


Re: SQL "Lock wait timeout exceeded"

by Stefano Bagnara-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Sorry Jerry, I never saw this error before.

How often do you get this? Is there a chance you can take stack dumps
right before this happen?

Stefano

Jerry M ha scritto:

> I'm sure this exception I'm getting is related to my db configuration.  
> But I don't have a clue where to start.  I'm running MySQL.  Can someone
> explain what this error is really telling me?  What is happening with
> MySQL, and what parameter(s) do I need to look at and possibly tweak on
> MySQL to prevent these problems in the future?  The CPU is nowhere near
> capacity.  So I don't believe this is simply a load problem.
>
> javax.mail.MessagingException: Exception caught while storing mail
> Container: ;
>  nested exception is:
>        java.sql.SQLException: Lock wait timeout exceeded; try restarting
> transaction
>        at
> org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepository.java:764)
>
>        at
> org.apache.james.transport.mailets.ToMultiRepository.storeMail(ToMultiRepository.java:230)
>
>        at
> org.apache.james.transport.mailets.ToMultiRepository.service(ToMultiRepository.java:154)
>
>        at
> org.apache.james.transport.mailets.LocalDelivery.service(LocalDelivery.java:66)
>
>        at
> org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:424)
>
>        at
> org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:405)
>
>        at
> org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:309)
>
>        at java.lang.Thread.run(Unknown Source)
> Caused by: java.sql.SQLException: Lock wait timeout exceeded; try
> restarting transaction
>        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
>        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
>        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
>        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
>        at com.mysql.jdbc.Connection.execSQL(Connection.java:3256)
>        at
> com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1313)
>
>        at
> com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:874)
>        at
> org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:168)
>
>        at
> org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepository.java:752)
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@...
> For additional commands, e-mail: server-user-help@...
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@...
For additional commands, e-mail: server-user-help@...


Parent Message unknown Re: SQL "Lock wait timeout exceeded"

by Jerry M :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Stephano,

I saw it about 20 times in a span of a few hours.  I don't know if it's
been happening in the past.  I just discovered it.  And I haven't seen
it since mid-day yesterday.

I'm a java programmer, and I understand stack dumps, etc.  But I'm not
sure what I need to do in order to capture a stack dump before the
problem occurs.  I'm willing to do whatever you suggest.  Just give me a
little more info on what to do.

Jerry


Stefano Bagnara wrote:

> Sorry Jerry, I never saw this error before.
>
> How often do you get this? Is there a chance you can take stack dumps
> right before this happen?
>
> Stefano
>
> Jerry M ha scritto:
>> I'm sure this exception I'm getting is related to my db
>> configuration.  But I don't have a clue where to start.  I'm running
>> MySQL.  Can someone explain what this error is really telling me?  
>> What is happening with MySQL, and what parameter(s) do I need to look
>> at and possibly tweak on MySQL to prevent these problems in the
>> future?  The CPU is nowhere near capacity.  So I don't believe this
>> is simply a load problem.
>>
>> javax.mail.MessagingException: Exception caught while storing mail
>> Container: ;
>>  nested exception is:
>>        java.sql.SQLException: Lock wait timeout exceeded; try
>> restarting transaction
>>        at
>> org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepository.java:764)
>>
>>        at
>> org.apache.james.transport.mailets.ToMultiRepository.storeMail(ToMultiRepository.java:230)
>>
>>        at
>> org.apache.james.transport.mailets.ToMultiRepository.service(ToMultiRepository.java:154)
>>
>>        at
>> org.apache.james.transport.mailets.LocalDelivery.service(LocalDelivery.java:66)
>>
>>        at
>> org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:424)
>>
>>        at
>> org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:405)
>>
>>        at
>> org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:309)
>>
>>        at java.lang.Thread.run(Unknown Source)
>> Caused by: java.sql.SQLException: Lock wait timeout exceeded; try
>> restarting transaction
>>        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
>>        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
>>        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
>>        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
>>        at com.mysql.jdbc.Connection.execSQL(Connection.java:3256)
>>        at
>> com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1313)
>>
>>        at
>> com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:874)
>>        at
>> org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:168)
>>
>>        at
>> org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepository.java:752)
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-user-unsubscribe@...
>> For additional commands, e-mail: server-user-help@...
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@...
> For additional commands, e-mail: server-user-help@...
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@...
For additional commands, e-mail: server-user-help@...


RE: SQL "Lock wait timeout exceeded"

by david.moss :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Lock wait timeout looks like a database issue to me.
Your database is probably doing something with the tables that is causing
your transaction to time out before the locks are released.

Timeout of transactions is controlled by MySql.
E.g.

innodb_lock_wait_timeout
The timeout in seconds an InnoDB transaction may wait for a row lock before
giving up. The default is 50 seconds. When trying to access a row that is
locked by another InnoDB transaction a connection will hang for at most this
many seconds before issuing the following error:  

ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction

MySql can use various table and row locking schemes so this is but one
example. You can specify the innodb_lock_wait_timeout system variable during
startup.

See:
http://dev.mysql.com/doc/refman/5.0/en/program-options.html
for more detail.

David Moss



-----Original Message-----
From: Jerry M [mailto:techstuff@...]
Sent: Thursday, 3 July 2008 1:43 AM
To: James Users List
Subject: Re: SQL "Lock wait timeout exceeded"

Stephano,

I saw it about 20 times in a span of a few hours.  I don't know if it's
been happening in the past.  I just discovered it.  And I haven't seen
it since mid-day yesterday.

I'm a java programmer, and I understand stack dumps, etc.  But I'm not
sure what I need to do in order to capture a stack dump before the
problem occurs.  I'm willing to do whatever you suggest.  Just give me a
little more info on what to do.

Jerry


Stefano Bagnara wrote:

> Sorry Jerry, I never saw this error before.
>
> How often do you get this? Is there a chance you can take stack dumps
> right before this happen?
>
> Stefano
>
> Jerry M ha scritto:
>> I'm sure this exception I'm getting is related to my db
>> configuration.  But I don't have a clue where to start.  I'm running
>> MySQL.  Can someone explain what this error is really telling me?  
>> What is happening with MySQL, and what parameter(s) do I need to look
>> at and possibly tweak on MySQL to prevent these problems in the
>> future?  The CPU is nowhere near capacity.  So I don't believe this
>> is simply a load problem.
>>
>> javax.mail.MessagingException: Exception caught while storing mail
>> Container: ;
>>  nested exception is:
>>        java.sql.SQLException: Lock wait timeout exceeded; try
>> restarting transaction
>>        at
>>
org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepository.
java:764)
>>
>>        at
>>
org.apache.james.transport.mailets.ToMultiRepository.storeMail(ToMultiReposi
tory.java:230)
>>
>>        at
>>
org.apache.james.transport.mailets.ToMultiRepository.service(ToMultiReposito
ry.java:154)
>>
>>        at
>>
org.apache.james.transport.mailets.LocalDelivery.service(LocalDelivery.java:
66)
>>
>>        at
>>
org.apache.james.transport.LinearProcessor.service(LinearProcessor.java:424)

>>
>>        at
>>
org.apache.james.transport.JamesSpoolManager.process(JamesSpoolManager.java:
405)
>>
>>        at
>>
org.apache.james.transport.JamesSpoolManager.run(JamesSpoolManager.java:309)

>>
>>        at java.lang.Thread.run(Unknown Source)
>> Caused by: java.sql.SQLException: Lock wait timeout exceeded; try
>> restarting transaction
>>        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
>>        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
>>        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
>>        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
>>        at com.mysql.jdbc.Connection.execSQL(Connection.java:3256)
>>        at
>>
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1313
)
>>
>>        at
>> com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:874)
>>        at
>>
org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPrepar
edStatement.java:168)
>>
>>        at
>>
org.apache.james.mailrepository.JDBCMailRepository.store(JDBCMailRepository.
java:752)

>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-user-unsubscribe@...
>> For additional commands, e-mail: server-user-help@...
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@...
> For additional commands, e-mail: server-user-help@...
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@...
For additional commands, e-mail: server-user-help@...




---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@...
For additional commands, e-mail: server-user-help@...

LightInTheBox - Buy quality products at wholesale price